How can we help you today?
Business Consultants Let our experts help you find the right solution for your unique needs.
855-834-8495 +1-570-708-8400 Hours: Mon-Fri 8am-11pm ET
Hours 24/7
Product Support We’re here to help with setup, technical questions, and more.
Hours 24/7
Knowledge Base Click here to learn more in our help center. Visit Help Center

Type above and press Enter to search. Press Esc to cancel.

Home Blog Domains & Hosting​ How to set up VPS hosting in 7 steps
Long form content featured image
,

How to set up VPS hosting in 7 steps

Key takeaways:

  • Setting up a VPS involves choosing a plan, securing your server, installing software, and connecting your domain. Your software choice determines part of the setup process.
  • Securing your VPS includes creating a non-root user, configuring SSH access, and setting up a firewall to help prevent unauthorized access.
  • VPS hosting gives you greater control over your server environment, but ongoing updates, backups, and maintenance remain your responsibility.

Learning how to set up VPS hosting starts with choosing the right plan, selecting an operating system, and configuring your server. A virtual private server (VPS) provides dedicated resources within a physical server, giving growing websites and small businesses more control over their hosting environment.

VPS hosting is a common next step for websites that have outgrown shared hosting and need more control over performance, security, and server settings. For more background, see our guides on what VPS hosting is and self-managed VPS hosting.

This guide is for website owners and small businesses setting up a VPS for the first time. It walks you through seven steps, from choosing a VPS plan and operating system to connecting to your server, securing access, installing web software, pointing your domain, enabling SSL, and testing your setup. By the end, you’ll understand how to set up a VPS and prepare it to host your website securely.

What you need before you start

Before setting up your VPS hosting, make sure you have the following:

  • Domain name: A registered domain that you’ll connect to your VPS so visitors can access your website. You can use an existing domain or register a new one.
  • SSH client: A tool that lets you securely connect to and manage your VPS remotely using Secure Shell (SSH). You can use Terminal on macOS or Linux, or PowerShell or PuTTY on Windows.
  • Basic command line knowledge: An understanding of how to type and run simple commands to install software, update your server, and configure security settings.

After purchasing your VPS hosting plan, your provider will give you the server’s IP address and initial root login credentials, including a root password if password-based authentication is enabled. You’ll use these details to connect to your server in the steps below.

How to set up a VPS

Learning how to set up a VPS involves choosing a hosting plan, connecting to your VPS server, and configuring its software and security settings. Follow these seven steps to set up your VPS, prepare your website for hosting, and test your server before going live.

VPS setup at a glance

  1. Choose your VPS plan and operating system
  2. Connect to your VPS with SSH
  3. Update the server and create a non-root user
  4. Secure SSH access and set up a firewall
  5. Install a control panel or web server
  6. Point your domain to the VPS and add SSL
  7. Test your setup

Step 1: Choose your VPS plan and operating system

Start by choosing a VPS plan that fits your website’s needs. Compare the available VPS packages based on CPU, RAM, storage, and expected traffic. Your VPS provider should offer operating system and software options that support your website’s requirements.

If you haven’t purchased a server yet, our VPS hosting solutions offer full root access and a choice of Linux distributions.

We provide three software options during setup:

  • Plain OS: A Linux operating system with no preinstalled control panel or web server. You’ll need to install and configure the software yourself. 
  • OS With Panel: A Linux server with a control panel already installed. The panel gives you a graphical interface for managing websites, files, databases, and other hosting settings without relying entirely on commands. Several panel options are available. 
  • Application: A preconfigured application or software stack that reduces manual installation work and helps you get started with your preferred software. Several options are available. 

Your selection determines whether you’ll need to install a web server or control panel in Step 5.

To complete your purchase, follow our VPS setup guide. Once your server is provisioned, locate it in your account manager and retrieve its IP address and initial login details.

Step 2: Connect to your VPS with SSH

After purchasing your VPS, you’ll need to connect to it using Secure Shell (SSH). This provides encrypted remote access to your virtual server, allowing you to manage it through the command line.

Find your VPS IP address and root login details in your hosting account.

For macOS or Linux:

  1. Open Terminal on your computer.
  2. Enter the following command, replacing YOUR_SERVER_IP with your VPS IP address:
Shell
ssh root@YOUR_SERVER_IP
  1. Accept the server’s host key after verifying its fingerprint through your hosting provider.
  2. Enter your root password if prompted.

For Windows:

  1. Open PowerShell and enter the same SSH command.
  2. Alternatively, open PuTTY, enter your VPS IP address, select SSH, and connect.
  3. Log in as root using the authentication method provided by your host.

Once connected, you can start configuring the Linux environment on your virtual machine.

Keep this SSH session open while completing the security steps. You’ll need it to confirm that your new login works before restricting root access.

Step 3: Update the server and create a non-root user

Before installing software, update your server’s packages and create a non-root user. This lets you handle everyday server tasks without continuously using the administrator account.

1. Update your server.

For Ubuntu, run:

Shell
sudo apt update
sudo apt upgrade -y

For AlmaLinux, Rocky Linux, CentOS, or Fedora, run:

Shell
sudo dnf upgrade -y

If a kernel update was installed, reboot with:

sudo reboot

Then, reconnect.

2. Create a new user.

Replace newuser with your preferred username.

For Ubuntu:

Shell
sudo adduser newuser
sudo usermod -aG sudo newuser

For AlmaLinux, Rocky Linux, CentOS, or Fedora:

Shell
sudo useradd -m newuser
sudo passwd newuser
sudo usermod -aG wheel newuser

3. Verify the user’s permissions.

Switch to the new account:

Shell
su - newuser

Then check its sudo privileges:

Shell
sudo whoami

If the command returns root, the new sudo user has administrative access.

You’ll use this non-root user for routine server management while reserving root-level access for tasks that require elevated permissions.

Step 4: Secure SSH access and set up a firewall

Next, secure your VPS by configuring SSH key authentication, restricting root login, and setting up a firewall. These measures help protect your server from unauthorized access and automated login attempts.

1. Generate an SSH key.

On your local computer, open Terminal or PowerShell and run:

Shell
ssh-keygen -t ed25519

Follow the prompts to create a public and private key pair. Set a passphrase for additional protection.

On macOS or Linux, copy the public key to your new server account:

Shell
ssh-copy-id newuser@YOUR_SERVER_IP

On Windows, you can add the public key manually to the new user’s ~/.ssh/authorized_keys file, with the correct file permissions.

2. Verify SSH access and disable root login.

Open a second terminal and test your new login:

Shell
ssh newuser@YOUR_SERVER_IP

Once key-based access works, edit the SSH configuration:

Shell
sudo nano /etc/ssh/sshd_config

Set PermitRootLogin no and, once all required SSH users can authenticate with keys, PasswordAuthentication no. Check for conflicting settings in the SSH configuration directory before applying changes.

Validate the configuration:

Shell
sudo sshd -t

If no errors appear, reload SSH:

On Ubuntu or Debian: 

sudo systemctl reload ssh

On AlmaLinux, CentOS Stream, Rocky Linux, and Fedora:

sudo systemctl reload sshd

3. Configure your firewall.

For Ubuntu, use Uncomplicated Firewall (UFW):

Shell
sudo apt install ufw -y
sudo ufw allow 22/tcp
sudo ufw enable
sudo ufw status

For AlmaLinux, Rocky Linux, CentOS, or Fedora, use firewalld:

Shell
sudo dnf install firewalld -y
sudo systemctl enable --now firewalld
sudo firewall-cmd --permanent --add-service=ssh
sudo firewall-cmd --reload
sudo firewall-cmd --list-all

These examples use the default SSH port, 22. If you’ve changed it, allow your configured SSH port before enabling firewall restrictions.

Step 5: Install a control panel or web server

Your next step depends on the software option you selected when you purchased your VPS. You can install a control panel or web server manually, or finish configuring a preinstalled application.

Option A: Install software on a Plain OS

A Plain OS installation includes only the operating system, so you’ll need to install the software required to host your website.

You have two main choices:

  • Control panel: Install a compatible panel to manage websites, domains, databases, and other hosting tasks through a graphical interface. Follow the panel provider’s installation instructions and confirm that it supports your Linux distribution.
  • Web server: Install Apache or Nginx to serve website files and applications. You’ll also need to configure virtual hosts for Apache or server blocks for Nginx when hosting your domain.

For example, install Apache on Ubuntu:

Shell
sudo apt install apache2 -y
sudo systemctl enable --now apache2

For AlmaLinux, Rocky Linux, CentOS, or Fedora:

Shell
sudo dnf install httpd -y
sudo systemctl enable --now httpd

Next, allow HTTP and HTTPS traffic through your firewall.

For Ubuntu:

Shell
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp

For AlmaLinux, Rocky Linux, CentOS, or Fedora:

Shell
sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --permanent --add-service=https
sudo firewall-cmd --reload

Option B: Configure your preinstalled panel or application

If you selected OS With Panel or Application, you can skip the initial software installation.

  • cPanel: A preinstalled hosting control panel that lets you complete initial server configuration, create hosting accounts, and manage websites through WHM and cPanel.
  • Preinstalled application: A ready-to-use deployment such as WordPress, aaPanel, or CloudPanel that guides you through the remaining setup steps.

These options let you complete much of the software setup through a web interface, often in just a few clicks.

Before accessing any panel or web applications, check the required network ports and allow them through your firewall. Limit administrative panel access to trusted IP addresses where possible.

Step 6: Point your domain to the VPS and add SSL

Once your web server is ready, point your domain name to your VPS so visitors can access your website.

1. Update your domain’s DNS settings.

Log in to your domain registrar or DNS provider and open the DNS management section.

Find the A record for your root domain and update it with your VPS IP address. If you’re using a www subdomain, configure its DNS record as well. If your domain also has an AAAA (IPv6) record pointing to another server, update or remove it, as a stale record can cause visitors to reach the wrong server or fail HTTPS validation. 

Save your changes. DNS changes may take anywhere from a few minutes to 48 hours to fully propagate, although many updates become visible much sooner.

2. Add your website files.

Upload your website files to the directory configured for your domain. If you’re using a control panel, follow its file management or website deployment instructions.

For a manual Apache or Nginx setup, configure the appropriate virtual host or server block so the domain loads the correct website.

3. Install an SSL certificate.

Once your domain points to your VPS and HTTP access works, install an SSL certificate to enable HTTPS.

You can use a certificate management feature in your control panel or a compatible tool such as Certbot for a manual web server installation.

Follow the installation prompts, enable HTTPS redirects, and confirm that automatic certificate renewal is configured.

Your website should now be accessible through its domain name with an encrypted HTTPS connection.

Step 7: Test your setup

Before using your VPS for a live website, confirm that your server, security settings, and domain are working correctly.

Use this checklist to test your configuration:

  • SSH access: Log in using your new non-root user and confirm that SSH key authentication works without root login.
  • Website access: Open your domain in a browser and check that your pages, images, and other website features load correctly.
  • SSL certificate: Confirm that your website uses HTTPS without certificate warnings.
  • Firewall settings: Review your rules and check that only the ports required for SSH, web traffic, and other necessary services are accessible.
  • Server configuration: Confirm that your web server or control panel is running and that your website files are in the correct location.

If everything works, your VPS is ready to host your website.

More Control Starts Here

Get more control over your website with Network Solutions VPS hosting. Choose your Linux OS, configure your server, and scale your resources as your business grows.

Common VPS setup mistakes

Even small configuration errors can prevent your VPS from working correctly or leave you locked out of your server. Watch out for these common mistakes when setting up your VPS.

  • Ignoring SELinux on AlmaLinux, CentOS Stream, and Fedora: Forgetting SELinux, a built-in security feature, can restrict what your web server can access. If your site returns a “403 Forbidden” error despite correct file permissions, check whether SELinux is blocking access. Adjust the file’s security context rather than disabling SELinux. 
  • Enabling the firewall before allowing SSH access: Blocking the SSH port can lock you out of your server. Always allow SSH traffic before activating your firewall, especially if you’re connecting through a public IP address rather than a private network.
  • Disabling password login too early: Turning off password authentication before confirming that your SSH keys work can prevent you from accessing your VPS. Test key-based login first before changing your authentication settings.
  • Closing your only active SSH session: Ending your current session before testing a new connection can leave you without a way back into the server. Keep your existing session open until you confirm that the new login works.
  • Choosing an incompatible operating system: Selecting an operating system that your control panel doesn’t support can prevent the software from working correctly. Verify compatibility before choosing a Linux distribution.
  • Testing your website before DNS propagation finishes: Testing your website before DNS changes finish propagating can make it appear unavailable even when the server is working correctly. Allow time for DNS updates to take effect before troubleshooting.

Avoiding these errors can help you complete your VPS setup more smoothly and reduce troubleshooting time.

What to do after setting up your VPS

Once your VPS is running, regular maintenance helps keep your website secure, stable, and performing well. Unlike managed hosting, self-managed VPS hosting puts you in charge of server administration, including operating system updates, security hardening, backups, package management, and performance tuning.

Here are five tasks to make part of your maintenance routine:

  • Schedule system updates: Regularly update your operating system and installed packages to fix security vulnerabilities, resolve bugs, and maintain software compatibility. Set a schedule for checking and applying updates or enable your operating system’s automatic security updates. 
  • Configure automatic backups: Schedule regular backups of your website files, databases, and server configurations. Consider daily backups for frequently updated websites, and periodically test restoring a backup to confirm your data can be recovered.
  • Monitor server resources: Track CPU usage, RAM, disk space, and network activity to identify performance issues before they affect visitors. Adjust your VPS resources when your website needs more capacity.
  • Verify SSL certificate renewals: Verify that automatic SSL renewal is working and check certificate expiration dates to prevent HTTPS errors.
  • Protect against repeated login attempts: Servers exposed to the internet receive constant automated login attempts. Consider installing a tool such as Fail2ban, which temporarily blocks IP addresses after repeated failed logins, as an extra layer on top of SSH key authentication. 

Your hosting provider’s support team may assist with infrastructure or account-related issues, but routine server administration remains your responsibility with a self-managed VPS.

Frequently asked questions

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

Use an SSH client to connect to your VPS using the server’s IP address and login credentials from your hosting provider. Once connected, you can manage your server through the command line.

Which Linux distro is best for a VPS?

Ubuntu is an excellent choice for beginners because of its documentation, community support, and straightforward package management. AlmaLinux is also a suitable option, especially if you are using a compatible hosting control panel or application. Other supported distributions suit different needs. 

Can I install WordPress on a VPS?

Yes. You can install WordPress manually using a web server, PHP, and a database, or choose a VPS with WordPress preinstalled to simplify the setup.

How to set up a VPS server for a website?

Choose a VPS plan and operating system, connect through SSH, configure security, install web hosting software, and point your domain to the server. Add an SSL certificate and test your website before launching.

Can I use a VPS for development and testing?

Yes. A VPS provides an isolated virtual environment where you can build and test websites, applications, and development environments without changing the host machine’s operating system.

Do I need technical knowledge to manage a VPS?

Basic command-line knowledge is helpful, especially for a self-managed VPS. You’ll need to handle software installation, security settings, and routine server administration.

Take control of your hosting with our VPS solutions

Your VPS is now secure, live, and ready to support your website. You have greater control over your server environment, with the flexibility to configure it around your business needs.

Ready to take the next step? Our VPS hosting solutions give you dedicated resources on shared physical hardware, fast NVMe SSD storage, and built-in DDoS protection to support your growing website.

We also offer free apps with every domain purchase, including tools for email marketing, customer management, and social media. Get the hosting flexibility and business tools you need to break through online.

Read more from this author

Hosting Built for Performance and Peace of Mind

Skip to section

Hosting Built for Performance and Peace of Mind

Short on time? Leave it to our expert designers.

  • Custom website design & copy
  • Your own in-house design team
  • Content with SEO in mind
  • Easy-to-reach support

Speak with an expert today!