Skip to Content
chalvien 1.0 is released
DocumentationVPS DocumentationProvisioningVPS Setup

VPS setup

Setting up a Virtual Private Server (VPS) for the first time may seem complex, but by following these steps you can create a secure and well-optimized environment for your applications. It’s important to note that VPS providers can differ significantly in terms of features, configuration options, and management tools. These differences can have a real impact depending on your specific use case. This documentation is based on Hostinger VPS, which is our current service provider. We are not affiliated with Hostinger in any way; it is referenced solely as an example. While the general principles apply broadly, some steps or options may vary if you are using a different provider.

Select Your VPS Plan

To begin, you must choose a hosting plan that fits your needs.

  • Pick a plan: The KVM 2 plan is recommended for beginners as it provides two virtual CPU cores, 8GB of RAM, and 100GB of NVMe disk space, which is sufficient for most web applications.
  • Select duration: Choosing a plan for 12 or 24 months maximizes savings and qualifies you for a free domain.
  • Server location: Hostinger will automatically recommend the location with the best latency for you; it is generally best to leave this on the default setting.

Choose Your Operating System

You have options for plain operating systems, those with control panels (like CloudPanel or Dokploy), or specific applications.

  • Select a plain OS: For a flexible, clean installation, select a Plain OS and choose Ubuntu.
  • Use the LTS version: Always ensure you select the LTS (Long-Term Support) version to receive security updates for several years.

Initial Dashboard Configuration

After completing your billing and payment, you will move to the setup phase.

  • Create a root password: You will be prompted to create a root password. Make it strong and write it down, as you will need it to log in to your VPS.
  • Finish setup: You may choose to skip the malware scanner for a “clean” initial install. Once the setup completes, click Manage VPS to enter your dashboard, where you can see your VPS IP address.

Update Your Server

Open the built-in browser terminal from the top right of your dashboard. It is essential to ensure your system is current before installing software. Run updates:

apt update && apt upgrade -y

This checks for and installs the latest security patches and software updates.

Create a Secure User Account

Logging in as “root” provides unrestricted control, which can be risky if mistakes are made.

Add a new user:

adduser username

Grant admin privileges:

usermod -aG sudo username

Switch user:

su - username

Set Up SSH Keys for Security

SSH keys allow you to log in securely without a password and are much harder for attackers to bypass. Generate Key on Your Computer: Open Windows PowerShell (or Terminal on Mac) and type:

ssh-keygen -t ed25519 -C "My Personal SSH Key"

Copy the Public Key: Locate the file ending in .pub, open it in a text editor, and copy its contents. Add Key to VPS: Back in the VPS browser terminal, create an SSH folder and a file named authorized_keys. Paste your public key into this file and save it. Set Permissions: Lock the files down so only your user can access them:

chmod 700 ~/.ssh chmod 600 ~/.ssh/authorized_keys

Restart SSH: Apply the changes by typing:

sudo systemctl restart ssh

Configure the Firewall (UFW)

A firewall controls which traffic is allowed into your VPS, keeping it locked down by default.

Allow Essential Ports: You must explicitly allow traffic for SSH and web browsing:

sudo ufw allow OpenSSH sudo ufw allow 80/tcp sudo ufw allow 443/tcp

Enable the firewall:

sudo ufw enable

Finalize and Monitor

Reboot to ensure all updates and firewall rules are synced.

sudo reboot

Dashboard Tools: Use the Hostinger dashboard to monitor CPU, RAM, and disk usage. You can also manage backups/snapshots or use the Kodee AI assistant in the bottom right corner for troubleshooting and common VPS tasks.