Skip to content
COL0

Linux VPS from scratch: how to prepare your first server securely

A VPS is a computer you rent that is always on and connected to the internet. Without setting it up, it starts receiving intrusion attempts within minutes.

Written by Victor Barrera

What a VPS is

A virtual private server (VPS) is a slice of a physical machine dedicated to you, with your own Linux and terminal access. Providers such as DigitalOcean, Hetzner, Vultr or AWS Lightsail offer them from a few dollars a month.

The basic security steps

  1. Log in over SSH and update everything: apt update && apt upgrade.
  2. Create your own user with administrator permissions (sudo) and stop using root.
  3. Use SSH keys instead of a password: you generate a pair on your computer and upload only the public key.
  4. Disable password login and root login in the SSH configuration.
  5. Enable the firewall and open only what is needed:
sudo ufw allow OpenSSH
sudo ufw allow 80
sudo ufw allow 443
sudo ufw enable
  1. Install fail2ban to block addresses that try to guess your access.
  2. Enable automatic security updates (unattended-upgrades).
  3. Set the time zone and the provider’s backups.

Common mistakes

  • Closing the session before checking that the SSH key works and locking yourself out.
  • Opening ports “just to test” and leaving them open, especially database ports.
  • Installing everything as root.
  • Not keeping a copy of your private key.

How we help

We prepare your server with security best practices and leave you a documented step-by-step so you understand every change.

Frequently asked questions

Which operating system should I choose?

Ubuntu Server LTS is the option with the most documentation and community, so almost any error has an answer online.

How much memory does my first VPS need?

For a small website or API, 1 GB of RAM is usually enough. If you will compile code or run several services, start with 2 GB.

Ready to publish your project?

Book your free 30-minute session and leave with a clear plan.

Book your free session