Knowledgebase

Ubuntu 22.04 VPS Setup: A Reseller-Friendly Walkthrough

Setting up a fresh Ubuntu 22.04 VPS is one of those jobs that looks intimidating the first time and routine by the twentieth. ThisHosting.rocks published a step-by-step walkthrough covering the essentials every sysadmin needs on day one: user creation, SSH key auth, firewall, timezone, updates, swap, and remote desktop over VNC.

For hosting resellers and small-agency operators who run infrastructure outside Plesk or cPanel, this is the unglamorous baseline work that determines whether your clients ever see a stable server or a 3 AM page.

The short version

  • Walkthrough covers Ubuntu 22.04 on a fresh VPS from a hosting provider.
  • Steps include creating a superuser, SSH key-based authentication, iptables firewall, timezone check, Apt updates, swap file creation, and VNC remote desktop.
  • Apache is used as the example web server.
  • The article is written for sysadmins comfortable with the command line.

The setup, step by step

Start with users. Once a fresh Ubuntu VPS is provisioned, the first task is creating a non-root superuser. Files and directories such as /home and tmp will be owned by the new account by default, and permissions need to be set so the user can write to them. Sudo lets you run root-level commands without logging in as root.

SSH key-based authentication is next. Password logins are a bad idea on any internet-facing box, and SSH keys give you both convenience and stronger security. The public/private key model means there is no password to leak in the first place.

Firewall comes third. Iptables is the most basic firewall tool on Linux and is the right starting point for a fresh VPS. Install it via apt-get and start dropping traffic you do not want.

Timezone is the fourth step. Ubuntu defaults to UTC, which is fine for servers but confusing when log timestamps need to match a client in a different region. Run `date` to check, then `sudo dpkg-reconfigure tzdata` to change it.

Updates come next. Ubuntu does not ship a graphical update tool, so Aptitude or apt-get is the path forward. `sudo apt-get update` refreshes the package index, and `sudo apt-get upgrade` installs newer versions of installed packages. The reference recommends turning off automatic updates for security reasons.

Swap is sixth. To run larger processes without hitting out-of-memory errors, create a swap file. The reference's example creates a 2 GB swap file via `dd`.

VNC is the final step. Remote desktop via VNC lets you control the VPS from a laptop or mobile device. Install vnc4server and vnc4client, then configure access with a password.

Who should care

Audience Why this matters When to skip
Hosting resellers Standardize client VPS baselines without panel licensing costs You already have Plesk/cPanel with automation
Freelance developers Spin up staging environments for custom configs Your clients already provide dev boxes
Small agencies Control over security hardening steps You lack time for ongoing server maintenance

Our analysis

The walkthrough is competent but dated. Ubuntu 22.04 is in standard support, and the iptables-first approach ignores the fact that ufw ships by default on modern Ubuntu and is easier to reason about. The swap example contains a unit discrepancy in the reference material that would trip up a first-time reader.

What the article does well is set the right order of operations. Users, then SSH keys, then firewall, then timezone, then updates, then swap. That is the order you actually want to follow because each step assumes the previous one worked.

What it skips is everything a production VPS needs beyond day one. There is no mention of fail2ban, no log monitoring, no backup configuration, no SSL, no DNS, no monitoring agent. For a real client workload you would not stop at VNC. You would follow up with a managed control panel or a configuration management tool like Ansible.

What to watch next

  • Migration from iptables to nftables as the default firewall backend on newer Ubuntu releases.
  • Ubuntu 22.04 standard support timeline, which determines when you need to plan OS refreshes for clients on older LTS branches.
  • Automation tools like Ansible or Cloud-init that can reproduce this baseline consistently across multiple VPS instances.

Bottom line: a useful baseline checklist for any sysadmin, but treat it as the floor, not the ceiling, of what a production VPS needs.

Key takeaways

  • Always disable root SSH login and use key-based auth from day one.
  • Ufw is easier to reason about than raw iptables for most setups.
  • Set timezone before you generate any logs or SSL certificates.
  • Pair the baseline with fail2ban and a backup agent before any client traffic touches the box.

Frequently asked questions

Do I need VNC on a headless production VPS?

Usually no. VNC is useful when you need a GUI for software that does not have a CLI interface. For most web workloads, SSH is enough.

Should I disable unattended-upgrades on a production VPS?

It depends. Unattended security updates reduce your patch window but can introduce unexpected reboots. Most production hosts enable patchmgr with a controlled schedule.

How much swap should I create?

A common rule of thumb is to match RAM size up to a cap of around 8 GB. Beyond that, you usually want more RAM rather than more swap.

Is iptables still the right firewall on Ubuntu 22.04?

It works, but ufw is the friendlier frontend and is enabled by default on most Ubuntu cloud images. Nftables is the long-term direction.

Can I skip the superuser step and run as root?

You can, but you should not. Operating as root accounts for almost all production compromises and makes audit trails useless.

Related