
Choosing the Right VPS
A cheap VPS from AsiaGB is perfect for beginners and small businesses looking to save on hosting costs. Starting from just 500 baht per month, you still get high quality with fast SSD storage and a reliable 99% uptime guarantee. Linux Ubuntu 20.04 or later is ideal for learning operating systems and server management.
Make sure your system has root access for all configuration steps. SSH access is equally important as it allows you to control your VPS securely from your personal computer. Check the connection details sent in your AsiaGB welcome email before starting the setup process.
Step 1: Connecting via SSH
Before starting your VPS setup, the first step is to connect via SSH (Secure Shell). SSH allows you to control your VPS securely from your personal computer. On Windows, use PuTTY or Windows Terminal. On Mac and Linux, open Terminal and type the command ssh root@YOUR_VPS_IP_ADDRESS.
The system will then ask for a password. Enter the password you received in your AsiaGB email. When the connection is successful, you'll see a terminal prompt, indicating you're ready for the next step.
- Windows: Use PuTTY or Windows Terminal
- Mac/Linux: Open Terminal and type ssh command
- Password: Check your AsiaGB email
Updating the Operating System
Once SSH connection is established, update your operating system to the latest version to reduce security risks. Type the command apt update && apt upgrade -y. This command will download and install all available security patches.
After the update completes, your system may need to restart. If prompted, type reboot to restart your VPS. This update is crucial as it protects your VPS from security vulnerabilities and attacks.
- Type:
apt update && apt upgrade -y - Wait for download completion
- Restart with:
reboot
Creating a Sudo User for Security
You shouldn't use the root account for regular work because it poses security risks. Instead, create a sudo user account. Type the command adduser username (replace username with your desired username). The system will ask for a password and other information.
Next, add this user to the sudo group by typing usermod -aG sudo username. When complete, log out from root and log in with your new account by typing su - username to test if you can use sudo.
adduser username– Create new userusermod -aG sudo username– Add sudo permissionssu - username– Switch to new accountsudo whoami– Test sudo access
Installing Nginx Web Server
Nginx is a lightweight and fast web server perfect for cheap VPS hosting. Type the command sudo apt install nginx -y. When installation completes, enable and start the service by typing sudo systemctl enable nginx && sudo systemctl start nginx.
Your Nginx is now running. To test it, open a web browser and go to http://YOUR_VPS_IP_ADDRESS. You should see Nginx's default page. Nginx configuration files are located in /etc/nginx/sites-available/. You can edit these files or add virtual hosts as needed.
sudo apt install nginx -y– Install Nginxsudo systemctl enable nginx– Enable auto-startsudo systemctl start nginx– Start service- Test: Visit http://YOUR_VPS_IP_ADDRESS
Installing PHP for Applications
To run PHP files on your VPS, you need to install PHP-FPM. Type the command sudo apt install php-fpm php-mysql php-curl php-mbstring -y. This installation includes important PHP modules like MySQL driver, cURL, and Multibyte String handling.
After installation completes, enable PHP-FPM by typing sudo systemctl enable php8.1-fpm && sudo systemctl start php8.1-fpm (or your installed version). Then configure Nginx to support PHP by editing /etc/nginx/sites-available/default and adding the location ~ \.php$ block to forward PHP files to the PHP-FPM socket.
sudo apt install php-fpm php-mysql php-curl php-mbstring -ysudo systemctl enable php8.1-fpmsudo systemctl start php8.1-fpm- Configure Nginx to support PHP
Installing MariaDB Database
For data storage, most VPS setups require a database system. Type the command sudo apt install mariadb-server -y. MariaDB is open-source and fully compatible with MySQL.
After installation, run the security script sudo mysql_secure_installation to set your database root password and disable remote connections. Configure it to be more restrictive. To learn more, log into MariaDB by typing sudo mariadb -u root. When successful, you'll see the mariadb> prompt.
sudo apt install mariadb-server -ysudo mysql_secure_installation– Configure securitysudo mariadb -u root– Log in to database- MariaDB is ready for your applications
Configuring Firewall with UFW
UFW (Uncomplicated Firewall) allows you to control incoming and outgoing connections to your VPS, which is critical for security. Type the command sudo ufw enable to activate the firewall. Then allow SSH, HTTP, and HTTPS traffic.
Type the following commands: sudo ufw allow 22/tcp (for SSH), sudo ufw allow 80/tcp (for HTTP), sudo ufw allow 443/tcp (for HTTPS). Check your firewall status with sudo ufw status. This configuration protects your VPS from unauthorized connections by allowing only necessary ports.
sudo ufw enable– Enable firewallsudo ufw allow 22/tcp– Allow SSHsudo ufw allow 80/tcp– Allow HTTPsudo ufw allow 443/tcp– Allow HTTPSsudo ufw status– Check status
Additional Tips for Beginners
Once setup is complete, remember these recommendations. First, create backups of important files such as databases and web content. You can use tools like rsync or tar. Second, install fail2ban to prevent brute force attacks on SSH ports. Type sudo apt install fail2ban -y.
Third, install a free SSL certificate from Let's Encrypt to enable HTTPS on your website. Use Certbot: sudo apt install certbot python3-certbot-nginx -y, then sudo certbot --nginx. Finally, continue learning Linux administration, such as cron scheduling, log monitoring, and service management. These skills will help you maintain and secure your VPS effectively.
- Create backups using rsync or tar
- Install fail2ban for enhanced security
- Install SSL certificates via Certbot and Let's Encrypt
- Learn Linux administration like cron and logs
Ready to get started? This article covers all the essential steps for setting up a cheap VPS as a beginner. If you're looking for an affordable VPS with SSD storage and 99% uptime, explore AsiaGB's VPS options starting from just 500 baht per month.
View AsiaGB Cheap VPS