Setting up and using a VPS (Virtual Private Server) from a Bangladeshi hosting provider (BD Hosting) is relatively straightforward. Here is a step-by-step guide to help you configure and use your VPS effectively.

Choose a VPS Provider

Key Features to Look For:

  • Server location (Bangladesh or nearby).
  • Customizable plans (CPU, RAM, storage).
  • Scalability (easy upgrades).
  • Managed vs. unmanaged VPS options.
  • Local payment methods (bKash, Nagad, etc.).

Purchase a VPS Plan

After selecting a provider:

  1. Visit their website and choose a VPS plan based on your requirements:
    • Operating System: Linux (Ubuntu, CentOS) or Windows Server.
    • Resources: CPU cores, RAM, storage, and bandwidth.
  2. Register an Account: Provide your details and domain name (if needed).
  3. Complete Payment: Use available local methods like bKash, Nagad, or credit cards.
  4. Receive Login Details: Once payment is confirmed, you will receive VPS access credentials via email.

Access Your VPS

For Linux VPS:

  • Access your VPS via SSH.
  • Open a terminal (or use tools like PuTTY for Windows).
  • Enter the SSH command:
  • ssh root@<your-vps-ip>
  • Input the root password provided by the hosting provider.

For Windows VPS:

  • Access using Remote Desktop Protocol (RDP).
  • Open the Remote Desktop application (pre-installed on Windows).
  • Enter your VPS IP address.
  • Log in with the username and password provided.

Basic Setup for Your VPS

Step 1: Update the Server

Keep your server up-to-date with the latest packages and security patches.

For Linux:

# Update and upgrade packages
sudo apt update && sudo apt upgrade -y

For Windows: Use the Windows Update feature.

Configure a Firewall

Set up a firewall to secure your VPS.

For Linux (Using UFW):

# Allow SSH
sudo ufw allow OpenSSH

# Enable the firewall
sudo ufw enable

For Windows: Use the Windows Defender Firewall to block unwanted connections.

Install a Web Server

If hosting a website or application, install a web server like Apache or Nginx.

Apache (Ubuntu):

sudo apt install apache2 -y
sudo systemctl start apache2
sudo systemctl enable apache2

Nginx (Ubuntu):

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

Access your web server in a browser using your VPS IP:

http://<your-vps-ip>

Install a Database Server

Install a database server for storing application data.

MySQL:

sudo apt install mysql-server -y
sudo mysql_secure_installation

PostgreSQL:

sudo apt install postgresql -y
sudo systemctl start postgresql

Install a Control Panel (Optional)

A control panel simplifies server management:

  • cPanel: Paid option with a user-friendly interface.
  • CyberPanel: Free and open-source.
  • Webmin: Lightweight and free.

Install CyberPanel (Example):

sh <(curl https://cyberpanel.net/install.sh | bash)

Deploy Your Website or Application

For Websites:

  1. Upload files via FTP or use Git for deployment.
  2. Configure your web server to point to your website directory.

For CMS (WordPress):

  1. Install WordPress:
  2. wget https://wordpress.org/latest.tar.gz
    tar -xvzf latest.tar.gz
    mv wordpress /var/www/html/
  3. Set permissions:
  4. sudo chown -R www-data:www-data /var/www/html/wordpress
    sudo chmod -R 755 /var/www/html/wordpress
  5. Configure Apache or Nginx for WordPress.

Secure Your VPS

Disable Root Login:

Prevent direct root access for security.

  1. Edit the SSH configuration:
  2. sudo nano /etc/ssh/sshd_config
  3. Change:
  4. PermitRootLogin no
  5. Restart SSH:
  6. sudo systemctl restart ssh

Create a New User:

sudo adduser newuser
sudo usermod -aG sudo newuser

Install SSL/TLS:

Secure your website with HTTPS.

  1. Install Certbot (for Let's Encrypt):
  2. sudo apt install certbot python3-certbot-nginx -y
  3. Configure SSL:
  4. sudo certbot --nginx

Monitor and Optimize

Monitor Resources: Use tools like htop or top for real-time monitoring:

htop

Optimize Performance:

  • Use caching (e.g., Redis, Memcached).
  • Optimize images and compress static files.

Backup Your VPS

Set up automated backups:

  1. Use hosting provider backup tools.
  2. Schedule local backups with rsync or similar tools.

Example:

rsync -av /var/www/html /backup/

Handle Traffic Surges

  • Use a CDN (e.g., Cloudflare) to offload traffic.
  • Enable DDoS protection if available.

By following these steps, you can set up and manage a VPS for various use cases like website hosting, application deployment, or personal projects.