← Back to all postsTutorials

How to Set Up a VPS for the First Time — Bangladesh Beginner Guide

Your first VPS login can feel intimidating. This guide walks you through everything — SSH, user setup, Nginx, and getting a site live — step by step.

Technical Support Dept.Published · Updated · 5 min read
On this page

Getting a VPS is easy. Actually using it for the first time is where most beginners freeze. You log in via SSH, see a blank terminal, and wonder what to type next.

This guide walks you through setting up a fresh VPS from scratch — specifically for a BDIX VPS from SNBD HOST running Ubuntu 22.04 LTS. By the end, you'll have a secured server with a working website. Everything here applies equally to a Singapore VPS if you're using that instead.

What You'll Need Before Starting#

  • A VPS from SNBD HOST (BDIX, Singapore, or USA — the setup process is identical)
  • Your server's IP address and root password (sent to your email after order)
  • An SSH client — Terminal on Mac/Linux, or Windows Terminal / PuTTY on Windows
  • About 30–45 minutes

Step 1: Log In as Root#

Open your terminal and connect to your server. Replace YOUR_SERVER_IP with the IP address in your welcome email:

code
ssh root@YOUR_SERVER_IP

You'll see a warning about the host fingerprint the first time — type yes and press Enter. Enter your root password when prompted. You're now inside your VPS.

The first thing you'll see is the Ubuntu welcome message and a prompt like root@hostname:~#. That hash symbol means you're running as root — the superuser with complete control over the system.

Step 2: Update the System#

Before doing anything else, update all installed packages to their latest versions:

code
apt update && apt upgrade -y

This downloads and installs security patches and bug fixes. It takes 2–5 minutes. Don't skip this step on a fresh server.

Step 3: Create a Non-Root User#

Running everything as root is a security risk. Create a regular user for day-to-day work:

code
adduser yourname

Follow the prompts — set a strong password and fill in the details (or press Enter to skip them). Then give this user sudo privileges so they can run admin commands when needed:

code
usermod -aG sudo yourname

Step 4: Set Up SSH Key Authentication#

Passwords are convenient but weaker than SSH keys. On your local machine (not on the server), generate an SSH key pair if you don't have one:

code
ssh-keygen -t ed25519 -C "your-email@example.com"

Accept the default location. Then copy your public key to the server:

code
ssh-copy-id yourname@YOUR_SERVER_IP

Or manually: display your public key with cat ~/.ssh/id_ed25519.pub, copy the output, then on the server:

code
mkdir -p /home/yourname/.ssh
nano /home/yourname/.ssh/authorized_keys

Paste your public key, save with Ctrl+O, exit with Ctrl+X. Set permissions:

code
chmod 700 /home/yourname/.ssh
chmod 600 /home/yourname/.ssh/authorized_keys
chown -R yourname:yourname /home/yourname/.ssh

Test that key-based login works before closing the root session:

code
ssh yourname@YOUR_SERVER_IP

Step 5: Secure SSH#

Edit the SSH configuration to disable root login and password authentication:

code
sudo nano /etc/ssh/sshd_config

Find and change these lines (add them if they don't exist):

code
PermitRootLogin no
PasswordAuthentication no
PubkeyAuthentication yes

Restart SSH:

code
sudo systemctl restart sshd

From now on, only your SSH key can log in. Brute-force password attacks become useless.

Step 6: Configure the Firewall#

Ubuntu includes UFW (Uncomplicated Firewall). Enable it and allow only the ports you need:

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

Check the status:

code
sudo ufw status

You should see SSH, HTTP (80), and HTTPS (443) listed as allowed. Everything else is blocked by default.

Step 7: Install Nginx#

Nginx is a fast, efficient web server — better than Apache for most modern use cases, and excellent on a VPS with limited RAM.

code
sudo apt install nginx -y
sudo systemctl enable nginx
sudo systemctl start nginx

Visit your server's IP in a browser: http://YOUR_SERVER_IP. You should see the Nginx welcome page. Your web server is running.

Step 8: Install PHP and MySQL (For PHP Sites)#

If you're running WordPress or any PHP application:

code
sudo apt install php8.1-fpm php8.1-mysql php8.1-xml php8.1-mbstring php8.1-curl php8.1-zip php8.1-gd -y
sudo apt install mysql-server -y
sudo mysql_secure_installation

Follow the MySQL setup wizard. Set a strong root password for MySQL, remove anonymous users, disable remote root login, and remove the test database.

Step 9: Create a Website#

Create a directory for your site and set up an Nginx server block (equivalent of Apache's virtual host):

code
sudo mkdir -p /var/www/yoursite.com
sudo chown -R $USER:$USER /var/www/yoursite.com

Create the Nginx config:

code
sudo nano /etc/nginx/sites-available/yoursite.com

Paste this configuration:

code
server {
    listen 80;
    server_name yoursite.com www.yoursite.com;
    root /var/www/yoursite.com;
    index index.php index.html;

    location / {
        try_files $uri $uri/ /index.php?$args;
    }

    location ~ .php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/run/php/php8.1-fpm.sock;
    }
}

Enable the site and reload Nginx:

code
sudo ln -s /etc/nginx/sites-available/yoursite.com /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl reload nginx

Step 10: Install an SSL Certificate#

Free SSL from Let's Encrypt — essential for HTTPS:

code
sudo apt install certbot python3-certbot-nginx -y
sudo certbot --nginx -d yoursite.com -d www.yoursite.com

Certbot will automatically edit your Nginx config to enable HTTPS and set up auto-renewal. Your site is now live with a valid SSL certificate at https://yoursite.com.

What You Now Have#

  • A fully secured Ubuntu VPS with SSH key authentication
  • A firewall that blocks everything except SSH, HTTP, and HTTPS
  • Nginx serving your website
  • PHP 8.1 and MySQL for dynamic applications
  • Free SSL with automatic renewal

This is the foundation. From here, you can deploy WordPress, install Node.js, run Docker containers, or set up any application you need. Your BDIX VPS gives you the compute and the local network advantage — the rest is up to your configuration.

Next Steps#

Now that your server is running, consider:

  • Setting up automatic security updates: sudo apt install unattended-upgrades -y
  • Installing Fail2ban to block brute-force attempts (covered in our security hardening guide)
  • Setting up regular backups to an external location
  • Installing a monitoring tool to alert you if the server goes down

Running a VPS feels intimidating the first time. After the second time, it feels like routine. The commands above cover 90% of what you'll do in a typical setup.

Tags:vps setupvps bangladeshlinux vpsubuntu vpsbeginner vpsssh tutorialnginx setup
Technical Support Dept.

Written by

Technical Support Dept.

Technical Support Dept is the tech backbone of SNBDHost, sharing clear, practical guides on hosting, performance, and security to help users keep their websites fast, stable, and secure.

Get new posts in your inbox

One email a month: new guides, product notes and automation recipes. No spam, unsubscribe anytime.

We respect your inbox — read our privacy policy.