Spinning up a new Ubuntu server is only the first step — a few basic configuration tasks up front will make your server more secure and easier to manage long-term. Here’s a straightforward walkthrough for getting a fresh Ubuntu VPS ready for real use.
1. Log In as Root
Connect to your server over SSH using its public IP address and your root password or private key:
ssh root@your_server_ip
Accept the host authenticity prompt if it appears, then authenticate with your password or SSH key.
The root account has unrestricted privileges on the system, which also makes it dangerous for everyday use — a single mistyped command can cause serious damage. The next step is to set up a regular user account for day-to-day work.
2. Create a New User
While logged in as root, create a new user account (replace sammy with whatever username you prefer):
adduser sammy
You’ll be prompted to set a password and, optionally, fill in a few extra details — feel free to leave those blank.
3. Grant Administrative (sudo) Privileges
Rather than switching back and forth between your new user and root, add the new account to the sudo group so it can run privileged commands when needed:
usermod -aG sudo sammy
From now on, prefixing a command with sudo runs it with administrative rights.
4. Set Up a Basic Firewall
Ubuntu ships with UFW (Uncomplicated Firewall), which makes it easy to restrict incoming connections to just the services you actually need. Check which application profiles are registered:
ufw app list
Make sure SSH stays allowed before you enable the firewall, or you’ll lock yourself out:
ufw allow OpenSSH
ufw enable
Confirm the rule is active:
ufw status
Any additional services you install later (a web server, a database, etc.) will need their own ufw allow rule before traffic can reach them.
5. Enable SSH Access for Your New User
Stay logged in as root until you’ve confirmed the new account works — that way you can troubleshoot from root if something goes wrong.
If your root account uses password login, just SSH in with the new username from a separate terminal session:
ssh sammy@your_server_ip
Run sudo before any command that needs elevated privileges; you’ll be prompted for your regular user’s password. For better security long-term, consider switching to SSH key authentication instead of passwords.
If your root account uses SSH keys, copy the authorized keys into the new user’s home directory so key-based login works for them too:
rsync --archive --chown=sammy:sammy ~/.ssh /home/sammy
Be careful not to add a trailing slash after ~/.ssh — that changes what rsync copies. Once done, you should be able to log in as the new user without a password:
ssh sammy@your_server_ip
Where to Go From Here
With a non-root user, sudo access, and a basic firewall in place, your server has a solid foundation. From here you’re ready to install whatever software your project needs.
Need somewhere to practice this? KwikServer’s Linux VPS plans give you full root access on a fresh Ubuntu image.