Lodaer Img

Basic Setup Guide for a Fresh Ubuntu Server

A new Ubuntu VPS works fine straight out of the box, but a few first-boot steps make it both more secure and easier to manage later. This is a straightforward walkthrough for getting a fresh Ubuntu server ready for real use.

1. Log in as root

ssh root@your_server_ip

Accept the host authenticity prompt if this is the first time connecting, then log in with your root password or SSH key.

Root can do anything on the system with no guardrails, which is exactly why you shouldn’t use it for day-to-day work; one mistyped command as root can cause real damage. The next few steps set up a regular user account with sudo access instead.

2. Create a new user

adduser sammy

You’ll be prompted for a password and, optionally, some details like a full name. None of the extra fields are required.

3. Grant sudo privileges

usermod -aG sudo sammy

This adds the new user to the sudo group, so they can run administrative commands by prefixing them with sudo instead of logging in as root directly.

4. Set up a basic firewall

Ubuntu ships with UFW, a simple front end for iptables.

ufw app list
ufw allow OpenSSH
ufw enable
ufw status

Allow OpenSSH before enabling the firewall. If you enable UFW first and forget this step, you’ll lock yourself out of the server. Any other service you install later, a web server or a database, will need its own ufw allow rule before traffic can reach it.

5. Enable SSH access for your new user

Stay logged in as root until you’ve confirmed the new account actually works, so you can troubleshoot from root if something’s wrong.

If you’re using password authentication, just switch users on your next connection, from a separate terminal session:

ssh sammy@your_server_ip

From there, prefix any command that needs elevated rights with sudo. If you’re using key-based authentication instead, copy your existing SSH key setup over to the new account:

rsync --archive --chown=sammy:sammy ~/.ssh /home/sammy

Don’t add a trailing slash after ~/.ssh, since that changes what rsync actually copies. Once that’s done, you should be able to log in as the new user without a password.

With a sudo user in place, SSH locked down to key or password login through a non-root account, and a basic firewall running, your server has a solid foundation for installing whatever software comes next. A KwikServer Linux VPS is a good place to practice this whole flow before putting anything into production.

Leave a Reply

Your email address will not be published. Required fields are marked *