/var/www, add a server block for your domain, point the domain’s DNS A record at the server, and enable HTTPS with Certbot. The steps below use Ubuntu 22.04 or 24.04 on a FlashRDP Linux VPS.
Step 1: Install Nginx
Log in to your server via SSH and install Nginx:http://YOUR_SERVER_IP in a browser and you should see the “Welcome to nginx!” page.
If you have enabled
ufw on the server, allow web traffic first: sudo ufw allow 'Nginx Full'. Ubuntu leaves ufw off by default.Step 2: Create a folder for your site
index.html, CSS and JavaScript files to /var/www/yourwebsite.com with an SFTP client such as FileZilla or Cyberduck. Use the same IP address and login you use for SSH; an SSH key is safer than a password.
Step 3: Add a server block for your domain
- Create a configuration file:
- Paste this, replacing
yourwebsite.comwith your domain:Save and exit nano withCtrl+X, thenY, thenEnter. - Enable the site, test the configuration and reload Nginx:
Step 4: Point your domain at the server
At your domain’s DNS provider, create an A record foryourwebsite.com and www pointing to your server’s IPv4 address. DNS changes can take from a few minutes to several hours to spread.