Skip to main content
Krystal
Krystal Blog

How to set up a VPS: Beginner’s guide to VPS hosting

Darren H, Senior Copywriter at Krystal, with a passion for writing, music, martial arts, and family adventures.

Darren H

6 Jun 20257 min read • Security, Servers, Tips & Tricks

If you’re used to shared hosting, switching to a Virtual Private Server (VPS) can feel like a big step. It’s not as plug-and-play as cPanel hosting, but it gives you far more flexibility and control. A VPS is a virtual private server that gives you dedicated resources and more control over how your hosting environment is configured. It’s a popular option for developers, growing websites, small businesses, and anyone who needs more power than shared hosting can offer.

If you’ve just bought a VPS and are wondering what to do next, this guide walks you through the basics. We’ll cover how to connect to your server, update it, lock down the essentials, choose your hosting setup, and get your website live.

With the right guidance, setting up a VPS is absolutely doable, even if you’re not a seasoned sysadmin. If you haven’t yet picked your VPS hosting plan, you can explore our UK-based VPS hosting options before diving in.

What you’ll need before you start

This guide is focused on unmanaged VPS hosting, starting from a fresh install. It’s designed as a practical, beginner-friendly VPS setup process, using common Linux operating systems such as Ubuntu and AlmaLinux.

You’ll need:

  • A VPS hosting plan from a reliable provider (Krystal VPS plans come with SSD/NVMe storage, DDoS protection, UK-based support and more)

  • A basic familiarity with using the command line

  • An SSH client:

    • Mac/Linux users can use the built-in Terminal
    • Windows users should download and install PuTTY
  • Your server’s IP address, root username and password (these are provided in your welcome email)

Step 1: choose the right VPS hosting plan

When choosing a VPS hosting plan, look for:

  • Enough CPU and RAM for your intended workload
  • NVMe storage (it’s faster)
  • Comprehensive security
  • A location close to your users (for UK-based sites, choose a hosting provider with a UK data centre)
  • Option to scale resources later
  • Solid sustainability credentials

Krystal’s VPS plans also include:

  • Unlimited bandwidth
  • Full root access
  • 2,000Gbps DDoS protection
  • Free setup and monthly snapshot backups
  • 60-day money-back guarantee
  • UK-based support, including live chat
  • VPS hosting powered by 100% renewable energy
  • A tree planted each month on your behalf

Once you’ve signed up, you’ll receive your server’s IP address, root login and password. If you’re still comparing options, you can browse our VPS hosting plans to see what’s included.

Step 2: connect to your VPS server

The first step in any VPS setup is logging in securely so you can start configuring your server.

Mac/Linux users:

  1. Open Terminal (you’ll find it in your Applications or search for it).
  2. Type the following command, replacing your-server-ip with your VPS IP address: ssh root@your-server-ip
  3. Press Enter. If it's your first time connecting, type yes to confirm.
  4. When prompted, enter the root password from your welcome email.

Windows users:

  1. Open PuTTY.
  2. In the Host Name field, enter your VPS IP address.
  3. Set Port to 22.
  4. Click Open. A terminal window will appear.
  5. Enter root as the username when prompted.
  6. Enter the password from your welcome email (note: nothing will appear as you type — that’s normal).

Once logged in, you’re ready to configure your server.

Step 3: update your VPS and create a new user

Before you start installing anything, update your VPS and create a non-root user for day-to-day admin tasks. This is one of the most important early steps in setting up a VPS properly.

Ubuntu/Debian

Open your terminal or PuTTY session and run:

apt update && apt upgrade -y
adduser yourusername
usermod -aG sudo yourusername

AlmaLinux/CentOS

dnf update -y
adduser yourusername
usermod -aG wheel yourusername

The wheel group on Alma/CentOS provides sudo privileges by default.

Disable root login

Disable direct root access over SSH. This is a basic but important VPS security measure.

Still connected via SSH, edit the SSH config file:

nano /etc/ssh/sshd_config

Look for the line PermitRootLogin and change it to:

PermitRootLogin no

Save and exit the file (in nano, press CTRL + X, then Y, then Enter), then restart SSH:

systemctl restart sshd

From now on, use your new user for logging in.

Step 4: configure your firewall and basic VPS security

Now that your VPS is up and running, it's time to secure it. First, you’ll set up a basic firewall for VPS to only allow essential types of traffic (like web and SSH access). Then, you'll install Fail2Ban, a tool that helps protect your server from repeated brute-force login attempts.

All of the commands below should be entered into the same terminal or SSH window you opened in Step 2.

A. Set up your firewall

For Ubuntu/Debian users:

Ubuntu uses a firewall tool called UFW (Uncomplicated Firewall), which makes managing firewall rules easier.

  1. Allow SSH so you don’t get locked out:
ufw allow OpenSSH
  1. Allow standard web traffic:
ufw allow 80
ufw allow 443

  • Port 80 is used for regular (non-secure) web traffic.

  • Port 443 is for secure HTTPS traffic.

  1. Enable the firewall:
ufw enable

You’ll be prompted to confirm. Type y and press Enter.

For AlmaLinux/CentOS users:

These systems use firewalld, a firewall management tool. Here’s how to allow SSH and web traffic:

  1. Add services to the firewall:
firewall-cmd --permanent --add-service=ssh
firewall-cmd --permanent --add-service=http
firewall-cmd --permanent --add-service=https
  1. Reload the firewall to apply the changes:
firewall-cmd --reload

Tip: These commands open up access to your server for management (SSH) and for your website (HTTP/HTTPS). If you're planning to host other types of services (like FTP or email), you'll need to open those ports too.

B. Install Fail2Ban

Fail2Ban helps protect your VPS from repeated login attempts by monitoring logs and banning suspicious IPs.

For Ubuntu/Debian:

apt install fail2ban -y

For AlmaLinux/CentOS:

First, install the EPEL (Extra Packages for Enterprise Linux) repository, which contains Fail2Ban:

dnf install epel-release -y

Then install Fail2Ban:

dnf install fail2ban -y

Once installed, make sure Fail2Ban is running and enabled so it can start monitoring common services. This should start automatically.

If you want to go further after the basics, read our guide to hardening and securing your Linux VPS.

Step 5: choose your VPS hosting setup

Once the core VPS setup is done, the next step is deciding how you want to host your websites or applications. Most users will either choose a control panel such as cPanel for an easier graphical experience, or install a web server or LAMP stack manually for more control.

For users who want a more familiar hosting experience, cPanel/WHM is often the simplest way to use a VPS. Before installing it, check the current cPanel system requirements and supported operating systems for your chosen setup.

To install cPanel:

  1. Make sure your server runs AlmaLinux or Ubuntu 22.04 (cPanel supports both).

  2. Log in as root and run:

cd /home && curl -o latest -L https://securedownloads.cpanel.net/latest && sh latest

The installation will take some time. Once complete, you'll be able to log in to WHM (Web Host Manager) via:

https://your-server-ip:2087

From there, you can configure your hosting environment, create cPanel accounts, manage DNS, and more.

Note: cPanel requires a licence – you can manage this via your Krystal Client Area.

Option B: install a web server stack manually

This is for users who prefer full control and aren’t using cPanel.

To install a LAMP stack on Ubuntu:

apt install apache2 mariadb-server php libapache2-mod-php php-mysql -y

To install on AlmaLinux:

dnf install httpd mariadb-server php php-mysqlnd -y

Then enable and start the services:

Ubuntu:

systemctl enable apache2
systemctl start apache2
systemctl enable mariadb
systemctl start mariadb

AlmaLinux:

systemctl enable httpd
systemctl start httpd
systemctl enable mariadb
systemctl start mariadb

To secure your database:

mysql_secure_installation

Step 6: secure your VPS

Security is an ongoing part of managing a VPS, not a one-off task. Once the basics are in place, these next steps will help keep your server in good shape.

  • Use Let’s Encrypt for free SSL certificates via Certbot

  • Keep your OS and packages updated

  • Enable automatic security patches

  • Set up regular backups (Krystal includes monthly snapshots with every VPS)

If you’re weighing up whether VPS is the right fit long term, it’s worth reading our guide on how to choose between shared hosting and VPS.

Step 7: upload your website and point your domain to your VPS

Once your server is set up and secured, the next step is to upload your website and point your domain name to your VPS so visitors can reach it.

1. Upload your website files

You can upload your website using an SFTP client like FileZilla (recommended for beginners) or push code from Git if you’re comfortable with it.

If you’ve installed Apache, your website files should go in this folder on your VPS:

/var/www/html

Make sure to delete the default index.html file that Apache creates, so your own homepage appears instead.

2. Point your domain name to your VPS

Log into your domain registrar (e.g. Krystal, GoDaddy, Namecheap) and update the A record for your domain to point to your VPS’s IP address. You’ll find that IP in your welcome email or VPS dashboard.

If your domain is managed with Krystal, this part is even easier – and our support team can help if you’re unsure.

If you’re wondering how to host a website on a VPS, this is the stage where your site starts becoming publicly accessible.

3. Restart Apache to apply any changes

Ubuntu:

systemctl restart apache2

AlmaLinux:

systemctl restart httpd

4. Test your site

Open your browser and type in your domain name. You should now see your site live. If not, give it a little time – DNS updates can take a few hours to fully propagate.

Bonus tip: If you’re using Krystal’s VPS platform, don’t forget you also have a 60-day money-back guarantee. It gives you time to get everything up and running with confidence.

What’s next?

If you’ve followed the steps above, you’ve built the foundations of a working VPS. It’s more hands-on than shared hosting, but the benefit is flexibility and control over how your environment is set up.

Common next steps include improving server security, installing additional software, refining your hosting setup, and making sure backups and updates are properly in place.

If you’d prefer a more hands-off option, Krystal also offers managed VPS hosting, where we help monitor your server, keep it updated, and support you as your requirements grow.

That said, VPS hosting isn’t always the best fit for every user. If you mainly need more performance without taking on server management, one of our Business Hosting plans may be a better option.

If you’re not sure which route is right for you, our team is always happy to help.

VPS setup FAQ

What is a VPS?

A VPS, or Virtual Private Server, is a virtual server that gives you dedicated resources and more control than shared hosting. It’s often used for websites, web apps, staging environments and custom hosting setups.

What is a VPS server used for?

A VPS server can be used to host websites, applications, databases, development environments and other online services that need more flexibility than shared hosting provides.

How do I connect to a VPS for the first time?

Most users connect to a VPS over SSH using Terminal on Mac/Linux or PuTTY on Windows. You’ll usually need your server IP address, a username, and your password from your hosting welcome email.

How to set up a VPS on Ubuntu?

A typical Ubuntu VPS setup includes connecting over SSH, updating packages, creating a new user, disabling root login, setting up a firewall, installing Fail2Ban, and then choosing your hosting setup.

Can I set up a VPS from Windows?

Yes. Windows users can connect to a VPS using a tool such as PuTTY. Once connected, the setup steps are broadly the same.

What should I do after buying a VPS?

After buying a VPS, your first steps should be logging in, updating the server, creating a non-root user, securing SSH access, enabling a firewall, and deciding how you want to host your website or application.

About the author

Darren H, Senior Copywriter at Krystal, with a passion for writing, music, martial arts, and family adventures.

Darren H

I'm Darren and I'm the Senior Copywriter at Krystal. Words are what I do. Aside from writing, I play guitar and sing in my band Machineries Of Joy and seek adventure with my wife and daughter.