No KYC · seven Linux VPS plans, one price in six cities · Pay in BTC, USDT, USDC, ETH, SOL, LTC, XMR
Language: English
Configure a VPS

Guide · web hosting · checked 16 November 2026

How do I host a website on a VPS?

Last updated: · 4 min read

Quick answer

How do I host a website on a VPS?

To host a website on a VPS, point your domain's A and AAAA records at the server, install nginx, put your files in a web root, write a server block, test it with nginx -t and reload. Then open ports 80 and 443 and add HTTPS. Every SaltVPS server has 1 dedicated IPv4 for this.

In brief
  • DNS first: an A record for the IPv4 and an AAAA record for an IPv6 from the server's /64.
  • Web server: nginx from the system repository is enough for static sites and reverse proxying.
  • One file per site in /etc/nginx/sites-available/, linked into sites-enabled/.
  • Always test with nginx -t before a reload.
  • HTTPS comes last, with a free Let's Encrypt certificate.

How do you host a website on a VPS with nginx?

Example domain: example.com. Commands for Ubuntu and Debian, run as root.

  1. Point the domain

    At your DNS provider, create an A record for example.com and www with the server IPv4. Add AAAA records if you serve over IPv6.

  2. Install nginx

    Run apt update then apt install nginx. The service starts on its own and serves a default page.

  3. Create the web root

    Run mkdir -p /var/www/example.com and upload your files there, with index.html at the top.

  4. Write a server block

    Create /etc/nginx/sites-available/example.com with listen 80, listen [::]:80, server_name example.com www.example.com, root /var/www/example.com and index index.html.

  5. Enable the site

    Run ln -s /etc/nginx/sites-available/example.com /etc/nginx/sites-enabled/. Remove the default link if you do not need it.

  6. Test and reload

    Run nginx -t. If it reports the syntax is ok, run systemctl reload nginx.

  7. Open the firewall and add HTTPS

    Run ufw allow 'Nginx Full' to open ports 80 and 443, then request a certificate with certbot.

Which DNS records does a website on a VPS need?

Two or four records cover most sites; mail needs its own records and a mail provider.

DNS records for a website hosted on a VPS with one IPv4 and an IPv6 range
RecordNamePoints toNeeded for
Aexample.comServer IPv4Visitors on IPv4
AwwwServer IPv4The www address
AAAAexample.comOne IPv6 from the server's /64Visitors on IPv6
AAAAwwwSame IPv6The www address on IPv6
MXexample.comYour mail provider's hostReceiving email, handled outside the VPS

What does a minimal nginx server block contain?

Five lines inside a server { } block are enough for a static site:

  • listen 80; and listen [::]:80;
  • server_name example.com www.example.com;
  • root /var/www/example.com;
  • index index.html;
  • location / { try_files $uri $uri/ =404; }

For an app that listens on a local port, such as Node.js on 3000, replace the location body with proxy_pass http://127.0.0.1:3000;. On AlmaLinux and Rocky Linux, nginx reads extra files from /etc/nginx/conf.d/ instead of sites-enabled.

Which VPS plan is best for hosting a website?

A static site or a small blog runs well on the smallest plans; a dynamic site with a database wants more RAM. SaltVPS checked its plan list on 16 November 2026: disks run from 40 GB NVMe on Grain to 640 GB NVMe on Dome, with 2 TB to 12 TB of traffic a month. The plan list pairs Flake (1 vCPU / 4 GB / 80 GB) with WordPress, at $4.50 a month on 12 months.

Compare all plans on the pricing page or read the self-hosting comparison. Moving an existing site? The migration guide covers files, databases and DNS.

How do you add HTTPS to the site?

Run certbot with its nginx plugin once DNS points at the server. It proves you control the domain, edits the server block and sets up renewal. The Let's Encrypt guide walks through each command.

One limit to know before you host a website on a VPS here: outbound port 25 is closed on every SaltVPS server. Contact forms and WordPress mail should send through a mail provider on port 465 or 587.

Hosting a website on a VPS: questions

Nginx or Apache for a website on a VPS?

Both work. Nginx is lighter for static files and reverse proxying; Apache suits sites that rely on .htaccess files.

Can I host several websites on one VPS?

Yes. Add one server block per domain, each with its own server_name and web root.

How long until DNS points at the new server?

It depends on the record's TTL. Records with a short TTL change within minutes; older cached answers can last up to the TTL value.

Where are the nginx logs?

In /var/log/nginx/: access.log for requests and error.log for problems.

Can I host a WordPress website on a VPS?

Yes. Add PHP-FPM and MariaDB or MySQL next to nginx, and send WordPress mail through an SMTP plugin on port 465 or 587.

Verdict
  • Hosting a website on a VPS takes DNS records, nginx, one server block and a certificate.
  • Plan by RAM: static sites fit Grain; WordPress and databases fit Flake or larger.
Sources (3)
  1. nginx beginner's guide — nginx.org (2026-11-16)
  2. How nginx processes a request (server names) — nginx.org (2026-11-16)
  3. Ubuntu Server documentation: web servers — Canonical (2026-11-16)

Host your site on your own server

Flake comes with 4 GB of RAM, 80 GB NVMe and a dedicated IPv4, paid in crypto.

From $2.25/mo on 12 months · no KYC

Configure