All articles
On this page

How to Set Up an Ubuntu VPS

Prepare an Ubuntu VPS with SSH access, updates, a firewall and an Nginx smoke test before deploying your website.

Host × IT·Published About 4 min read

Setting up an Ubuntu VPS starts with reliable administrator access and a small, testable network configuration. This guide prepares a fresh server and checks a basic Nginx web service. It does not deploy your application or configure a production HTTPS site. If the server already hosts live services, review its configuration and recovery plan before changing it.

1. Prepare access and recovery

Collect the server IP, initial account, SSH port and provider console or recovery method. Use the actual Ubuntu release and software versions supplied with your server. Ask support before changing a managed configuration. Keep credentials out of public screenshots and repositories.

Connect using your assigned account; replace the example address and account below. If your provider uses another SSH port, add its documented port with the SSH client's -p option.

ssh your-user@SERVER_IP
lsb_release -ds

On first connection, verify the host-key fingerprint through a trusted provider channel before accepting it. An unexpected key change on an existing server needs investigation.

2. Establish a working administrator account

If the initial login is root, create a separate account and grant sudo access. If the provider already supplied a sudo-enabled account, use that instead of making a duplicate.

adduser webadmin
usermod -aG sudo webadmin

Install your public SSH key for the chosen account using your normal key-management process. Open a second session and verify both login and sudo access before changing root or password-login settings. Keep the original session and console available. Validate any later SSH configuration changes with sudo sshd -t before reloading the service; do not disable your only working login method.

3. Apply updates in a suitable window

sudo apt update
sudo apt upgrade

Read the proposed package changes and prompts. Updates can restart services; a reboot may also be required. On a fresh server, finish required restarts and reconnect before proceeding. For existing services, schedule maintenance and retain a tested recovery route.

4. Allow SSH before enabling the firewall

Check existing rules with sudo ufw status verbose. For a fresh server using TCP port 22 for SSH, the following sequence allows access before enabling the firewall. If SSH uses a custom port, replace 22 with the actual port first. Review both IPv4 and IPv6 rules where applicable.

sudo apt install ufw
sudo ufw allow 22/tcp
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
sudo ufw enable
sudo ufw status verbose

Also check the provider's network firewall, which is separate from UFW. Test a second SSH connection after enabling the rules. Do not expose database ports just to make an application connection easier; keep database access private unless there is a specific secured requirement.

5. Install Nginx and run a smoke test

sudo apt install nginx curl
sudo nginx -t
sudo systemctl status nginx --no-pager
curl -I http://127.0.0.1

Open the server's public IP in a browser over HTTP to check external reachability. A default Nginx response confirms the web service is reachable, not that your application is deployed. If localhost works but the public test fails, inspect the listening address, UFW, provider firewall and IP assignment.

6. Finish the website deployment

Point the domain's DNS records to the intended server. Add an AAAA record only if IPv6 is configured and reachable. Configure an Nginx site for that domain and either serve the intended static files or proxy to the application listening on a local interface. Validate configuration before reloading Nginx.

Obtain and configure a certificate for the domain using a supported certificate client, verify renewal, and test HTTPS before redirecting HTTP. Opening port 443 alone does not enable HTTPS. For dynamic applications, configure a service that starts after reboot, keep secrets outside public files, and test logs, database access and a real user action.

7. Verify recovery and ownership

  • Reconnect after any planned reboot and verify application startup.
  • Store backups separately from the server and test a restore.
  • Record update ownership, monitoring and certificate renewal.
  • Remove temporary support access once the agreed work is complete.

If you need help with a managed Ubuntu VPS, use the VPS support guide with the server reference, OS version, symptom and redacted logs. Compare Windows and Linux requirements before choosing an OS, or return to the VPS beginner’s guide if these responsibilities are new.

Is a dedicated IP enough to launch the website?

No. DNS, the web server, application configuration and HTTPS must also be correct. Compare current VPS options and confirm the deployment work you want help with.

🎉 Vibe Hosting is now Host × IT!

Your services are unaffected. Welcome to our new website.

View brand upgrade details