EQVPS

How to set up an Ubuntu VPS (first steps after you get root)

The first ten minutes on a fresh Ubuntu 24.04 VPS: update packages, create a non-root sudo user, add your SSH key, turn off password login, enable the UFW firewall and automatic security updates. Copy-paste commands.

You've paid, you have root, and you're staring at a fresh Ubuntu 24.04 prompt. This is the first ten minutes done right: get the box patched, off root, behind keys and a firewall. Copy-paste, in order.

1. Update the system

apt update && apt upgrade -y

A fresh image is rarely fully patched. Do this first, every time.

2. Create a non-root sudo user

Don't run as root day-to-day. Make a normal user and give it sudo:

adduser deploy            # set a password when prompted
usermod -aG sudo deploy

3. Add your SSH key to that user

From your own machine you already generated a key (how to set up SSH keys). Install its public half for the new user:

# on the server, as root
mkdir -p /home/deploy/.ssh
# paste your PUBLIC key into authorized_keys
nano /home/deploy/.ssh/authorized_keys
chown -R deploy:deploy /home/deploy/.ssh
chmod 700 /home/deploy/.ssh && chmod 600 /home/deploy/.ssh/authorized_keys

Open a second terminal and confirm ssh deploy@YOUR.SERVER.IP works before the next step — so a mistake can't lock you out.

4. Turn off password and root SSH login

Once the key works:

sudo sed -i 's/^#\?PasswordAuthentication.*/PasswordAuthentication no/' /etc/ssh/sshd_config
sudo sed -i 's/^#\?PermitRootLogin.*/PermitRootLogin no/' /etc/ssh/sshd_config
sudo systemctl restart ssh

Now only your key gets in, and the constant brute-force noise on port 22 bounces off.

5. Enable the firewall

Allow SSH before enabling, then only what you need:

sudo ufw allow OpenSSH
sudo ufw enable          # confirms; SSH stays open

Full details in how to configure a UFW firewall.

6. Turn on automatic security updates

sudo apt install -y unattended-upgrades
sudo dpkg-reconfigure -plow unattended-upgrades   # choose "Yes"

The box now patches its own security updates while you sleep.

That's the baseline

Patched, off root, key-only, firewalled, auto-updating — that's a sane starting point for anything. Next steps depending on what you're building:

On Debian instead of Ubuntu? The steps are nearly identical — see how to set up a Debian VPS. EQVPS gives you a clean Ubuntu 24.04 image with root in about a minute, no KYC, paid in crypto.

FAQ

What should I do first on a new Ubuntu VPS?

Update packages, then create a non-root user with sudo, add your SSH public key to it, and disable password/root SSH login. That closes the two biggest risks on a fresh box — an unpatched system and password brute-force on root — in a few commands. Then enable UFW and unattended-upgrades. The steps are below.

Should I keep logging in as root?

No. Create a normal user with sudo and log in as that instead. Running as root full-time means any mistake or compromised process has the whole machine; a sudo user limits the blast radius and is the standard practice. Root SSH login is also the first thing bots try.

Do I need a firewall if the VPS is fresh?

Yes — enable UFW with SSH allowed first, then only the ports you actually use. A default-deny firewall shrinks your attack surface to the services you run. Just remember to 'ufw allow OpenSSH' before 'ufw enable' or you'll lock yourself out.

Which Ubuntu version should I run on a VPS?

Ubuntu 24.04 LTS — long-term support, current packages, and the version these commands target. LTS releases get security updates for years, which is what you want on a server you leave running.

Do you ask for ID or a card to rent an Ubuntu VPS?

No. Email to sign up, pay in USDC or USDT — no documents, no card. You get a clean Ubuntu image with root in about a minute.

Comments

No comments yet. Be the first.

Leave a comment

Comments are moderated before they appear.