VPS Tutorials & Installations

Your comprehensive guide to Linux and Windows server management.

Linux VPS Tutorials

Explore detailed guides for setting up and managing your Linux VPS.

1. Docker Installation & Basic Usage on Ubuntu

Learn how to install Docker on Ubuntu and run your first containerized application.

Install Docker Engine

sudo apt update
sudo apt install apt-transport-https ca-certificates curl gnupg lsb-release -y
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt update
sudo apt install docker-ce docker-ce-cli containerd.io -y
sudo systemctl start docker
sudo systemctl enable docker
sudo usermod -aG docker $USER
# Log out and log back in for group changes to take effect

Run a Sample Nginx Container

docker run --name my-nginx -p 80:80 -d nginx
# Access Nginx at http://your_vps_ip

2. Setting up a LAMP Stack on Ubuntu

Install Apache, MySQL, and PHP to host dynamic websites.

Install Apache

sudo apt update
sudo apt install apache2 -y
sudo systemctl enable apache2 --now

Install MySQL Server

sudo apt install mysql-server -y
sudo mysql_secure_installation
# Follow prompts to set root password, remove anonymous users, disallow root login remotely, etc.

Install PHP and Modules

sudo apt install php libapache2-mod-php php-mysql php-cli php-curl php-json php-gd php-mbstring php-xml php-zip -y
sudo systemctl restart apache2

3. Installing Node.js with NVM on Linux

Manage multiple Node.js versions easily using Node Version Manager (NVM).

Install NVM

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
# Close and reopen your terminal, or run:
export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion

Install Latest Node.js and Set as Default

nvm install node
nvm use node
nvm alias default node
node -v
npm -v

4. Basic Firewall Setup with UFW on Ubuntu

Secure your VPS by configuring a simple firewall to control network access.

Install and Enable UFW

sudo apt update
sudo apt install ufw -y
sudo ufw default deny incoming
sudo ufw default allow outgoing

Allow Essential Services

sudo ufw allow ssh        # Port 22 (or your custom SSH port)
sudo ufw allow http       # Port 80
sudo ufw allow https      # Port 443
sudo ufw enable           # Enable the firewall (confirm with 'y')
sudo ufw status verbose

5. Installing Git on Linux

Set up Git for version control on your Linux VPS.

Install Git

sudo apt update
sudo apt install git -y
git --version

Configure Git User Information

git config --global user.name "Your Name"
git config --global user.email "[email protected]"

6. Installing PostgreSQL on Ubuntu

Set up the powerful open-source relational database PostgreSQL.

Install PostgreSQL Server

sudo apt update
sudo apt install postgresql postgresql-contrib -y
sudo systemctl enable postgresql --now

Set PostgreSQL User Password

sudo -i -u postgres psql -c "ALTER USER postgres WITH PASSWORD 'your_new_password';"
# IMPORTANT: Replace 'your_new_password' with a strong password!

7. Installing Nginx Web Server on Ubuntu

Set up a high-performance web server and reverse proxy.

Install Nginx

sudo apt update
sudo apt install nginx -y
sudo systemctl enable nginx --now
sudo ufw allow 'Nginx HTTP'
sudo ufw allow 'Nginx HTTPS'
sudo ufw reload

Basic Nginx Server Block Configuration

sudo nano /etc/nginx/sites-available/your_domain.conf
# Add the following content (replace your_domain.com and path):
# server {
#     listen 80;
#     listen [::]:80;
#     server_name your_domain.com www.your_domain.com;
#     root /var/www/html/your_domain;
#     index index.html index.htm;
#     location / {
#         try_files $uri $uri/ =404;
#     }
# }
# Save and exit.
sudo ln -s /etc/nginx/sites-available/your_domain.conf /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl reload nginx

8. Installing and Configuring Fail2Ban on Ubuntu

Protect your server from brute-force attacks by banning malicious IPs.

Install Fail2Ban

sudo apt update
sudo apt install fail2ban -y

Configure Fail2Ban (jail.local)

sudo cp /etc/fail2ban/jail.conf /etc/fail2ban/jail.local
sudo nano /etc/fail2ban/jail.local
# Inside jail.local, you can enable/configure jails. For example, to enable SSH protection:
# [sshd]
# enabled = true
# port = ssh
# filter = sshd
# logpath = /var/log/auth.log
# maxretry = 5
# bantime = 1h
# Save and exit.
sudo systemctl enable fail2ban --now
sudo systemctl restart fail2ban
sudo fail2ban-client status sshd

9. Setting up a Basic OpenVPN Server on Ubuntu

Create your own private VPN server for secure browsing.

Automated OpenVPN Install Script

wget https://raw.githubusercontent.com/Nyr/openvpn-install/master/openvpn-install.sh
chmod +x openvpn-install.sh
sudo ./openvpn-install.sh
# Follow the on-screen prompts to configure your OpenVPN server, create client profiles, and manage users.
# This script handles most of the complex setup automatically.

10. Installing and Using Tmux on Linux

Enhance your terminal workflow with a powerful terminal multiplexer.

Install Tmux

sudo apt update
sudo apt install tmux -y

Basic Tmux Usage

tmux new-session -s my_session  # Create a new session named 'my_session'
# Inside tmux:
# Ctrl+b d  (detach from session)
# tmux attach -t my_session (re-attach to session)
# Ctrl+b %  (split pane vertically)
# Ctrl+b "  (split pane horizontally)
# Ctrl+b arrow_key (navigate between panes)
# Ctrl+b x  (close current pane)
# Ctrl+b c  (create new window)
# Ctrl+b n  (next window)
# Ctrl+b p  (previous window)

11. Installing and Configuring Certbot (Let's Encrypt) for Nginx on Ubuntu

Automate free SSL/TLS certificates for your Nginx web server.

Install Certbot and Nginx Plugin

sudo apt update
sudo apt install certbot python3-certbot-nginx -y

Obtain and Install SSL Certificate

sudo certbot --nginx -d your_domain.com -d www.your_domain.com
# Follow the interactive prompts. Certbot will automatically configure Nginx and set up renewals.

12. Installing MongoDB on Ubuntu

Set up the popular NoSQL database for your applications.

Import MongoDB GPG Key

sudo apt update
sudo apt install gnupg curl -y
curl -fsSL https://www.mongodb.org/static/pgp/server-6.0.asc | sudo gpg --dearmor -o /usr/share/keyrings/mongodb-archive-keyring.gpg

Create a List File for MongoDB

echo "deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg ] https://repo.mongodb.org/apt/ubuntu $(lsb_release -cs)/mongodb-org/6.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list

Install MongoDB Packages

sudo apt update
sudo apt install -y mongodb-org
sudo systemctl enable mongod --now
sudo systemctl status mongod

13. Installing PHPMyAdmin on Ubuntu

Manage your MySQL/MariaDB databases via a web interface.

Install phpMyAdmin

sudo apt update
sudo apt install phpmyadmin -y
# During installation, choose 'apache2' when prompted for web server and configure database if asked.
sudo ln -s /etc/phpmyadmin/apache.conf /etc/apache2/conf-available/phpmyadmin.conf
sudo a2enconf phpmyadmin
sudo systemctl reload apache2
# Access phpMyAdmin at http://your_server_ip/phpmyadmin

14. Installing and Configuring Cron Jobs on Linux

Automate repetitive tasks on your Linux server.

Edit User Crontab

crontab -e
# This will open a text editor (like nano or vim) for your user's crontab file.
# Add your cron job entries here.
# Example: Run a script daily at 3:30 AM
# 30 3 * * * /path/to/your/script.sh
# Example: Run a command every 5 minutes
# */5 * * * * /usr/bin/command_to_run
# Save and exit.

View Existing Cron Jobs

crontab -l

15. Installing and Using Htop on Linux

Monitor your system's processes interactively.

Install Htop

sudo apt update
sudo apt install htop -y

Run Htop

htop

More Linux Tutorials Coming Soon!

We are continuously adding more detailed guides for Linux server management. Check back soon for topics like: Python virtual environments, Redis caching, Samba file sharing, advanced Nginx configurations, and many more!

Windows VPS Tutorials

Discover guides for installing software and configuring your Windows Server VPS.

1. Installing IIS (Web Server) on Windows Server

Set up Internet Information Services to host websites on your Windows VPS.

Install IIS via PowerShell

Install-WindowsFeature -Name Web-Server -IncludeManagementTools
# After installation, you can access the default IIS page by navigating to your VPS IP in a web browser.

Add a New Website (Example)

# Open IIS Manager (Server Manager -> Tools -> Internet Information Services (IIS) Manager)
# In the Connections pane, expand your server name -> Sites.
# Right-click Sites and select 'Add Website...'.
# Fill in Site name, Physical path, Binding (IP address, Port, Host name), and click OK.

2. Installing SQL Server Express on Windows Server

Install a free edition of Microsoft SQL Server for database management.

Download SQL Server Express

# Visit Microsoft's official SQL Server Express download page.
# Download the installer (e.g., SQL2019-SSEI-Expr.exe).
# Run the installer and choose 'Basic' or 'Custom' installation.
# For 'Basic', it will install with default settings. For 'Custom', you can choose features and installation path.

Install SQL Server Management Studio (SSMS)

# SSMS is a separate download. Visit Microsoft's SSMS download page.
# Download and run the SSMS installer.
# This tool is essential for managing your SQL Server databases.

3. Installing Node.js on Windows Server

Get Node.js and npm running on your Windows VPS for JavaScript development.

Download Node.js Installer

# Visit the official Node.js website (nodejs.org).
# Download the Windows Installer (.msi) for the LTS (Long Term Support) version.
# Run the installer and follow the wizard steps (accept defaults for most users).
# This will install Node.js and npm (Node Package Manager).

Verify Installation in PowerShell/CMD

node -v
npm -v

4. Configuring Windows Firewall for Specific Ports

Allow incoming connections for your applications through Windows Firewall.

Allow HTTP (Port 80) via PowerShell

New-NetFirewallRule -DisplayName "Allow HTTP (Web Server)" -Direction Inbound -Action Allow -Protocol TCP -LocalPort 80

Allow HTTPS (Port 443) via PowerShell

New-NetFirewallRule -DisplayName "Allow HTTPS (Secure Web Server)" -Direction Inbound -Action Allow -Protocol TCP -LocalPort 443

Allow Custom Port (e.g., Port 5000)

New-NetFirewallRule -DisplayName "Allow Custom App Port 5000" -Direction Inbound -Action Allow -Protocol TCP -LocalPort 5000

5. Installing Python on Windows Server

Set up Python for scripting and application development on your Windows VPS.

Download Python Installer

# Visit the official Python website (python.org).
# Download the latest stable Windows installer (e.g., 'Windows installer (64-bit)').
# Run the installer. IMPORTANT: Check 'Add Python X.X to PATH' during installation.
# This makes Python and pip accessible from CMD/PowerShell.

Verify Installation and Pip

python --version
pip --version

6. Installing and Configuring PowerShell Core on Windows Server

Install the cross-platform version of PowerShell for advanced scripting.

Install PowerShell Core via Winget (Windows Package Manager)

winget install --id Microsoft.PowerShell --source winget
# If winget is not installed, you might need to install App Installer from Microsoft Store.

Verify Installation

pwsh -v

7. Enabling Remote Desktop for Non-Admin Users on Windows Server

Allow standard users to connect via RDP.

Add User to Remote Desktop Users Group via PowerShell

Add-LocalGroupMember -Group "Remote Desktop Users" -Member "YourUsername"
# Replace "YourUsername" with the actual username you want to grant RDP access to.

Verify Group Membership

Get-LocalGroupMember -Group "Remote Desktop Users"

8. Installing and Configuring OpenSSH Server on Windows Server

Enable secure shell access to your Windows VPS.

Install OpenSSH Server via PowerShell

Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0

Start and Enable OpenSSH Service

Start-Service sshd
Set-Service -Name sshd -StartupType 'Automatic'

Configure Firewall for SSH

New-NetFirewallRule -DisplayName "OpenSSH (Port 22)" -Direction Inbound -Action Allow -Protocol TCP -LocalPort 22

9. Installing and Using Git on Windows Server

Set up Git for version control on your Windows VPS.

Download Git for Windows Installer

# Visit the official Git for Windows website (git-scm.com/download/win).
# Download the latest installer.
# Run the installer and follow the wizard steps. It's generally safe to accept defaults.

Verify Installation and Configure User Info

git --version
git config --global user.name "Your Name"
git config --global user.email "[email protected]"

10. Installing .NET Core Runtime on Windows Server

Enable your Windows VPS to run .NET Core applications.

Download .NET Core Hosting Bundle

# Visit the official .NET download page (dotnet.microsoft.com/download).
# Download the '.NET Hosting Bundle' for Windows Server (choose the LTS version).
# This bundle includes the .NET Runtime, .NET SDK, and ASP.NET Core Module for IIS.
# Run the installer and follow the wizard.

Verify Installation in PowerShell/CMD

dotnet --list-runtimes

11. Setting up a Scheduled Task on Windows Server

Automate scripts or programs to run at specific times.

Create a Basic Scheduled Task via PowerShell

$Action = New-ScheduledTaskAction -Execute "C:\Path\To\Your\Script.ps1"
$Trigger = New-ScheduledTaskTrigger -Daily -At "3:00 AM"
Register-ScheduledTask -Action $Action -Trigger $Trigger -TaskName "MyDailyScript" -Description "Runs my daily backup script."
# Replace "C:\Path\To\Your\Script.ps1" with your script path.

View Scheduled Tasks

Get-ScheduledTask | Format-Table TaskName, State

12. Installing and Configuring Apache HTTP Server on Windows Server

Set up an alternative web server on your Windows VPS.

Download Apache for Windows

# Visit Apache Lounge (apachelounge.com) or ApacheHaus (apachehaus.com) for Windows binaries.
# Download the appropriate version (e.g., httpd-2.4.xx-win64-VSxx.zip).
# Extract the contents to a directory like C:\Apache24.

Install Apache as a Service

# Open PowerShell as Administrator
cd C:\Apache24\bin
.\httpd.exe -k install -n "Apache2.4"
# Start the service
Start-Service Apache2.4

13. Installing and Using Chocolatey (Package Manager) on Windows Server

Simplify software installation on Windows with Chocolatey.

Install Chocolatey via PowerShell

Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
# Run this command in an elevated PowerShell (Run as Administrator).

Install Sample Software (e.g., Google Chrome)

choco install googlechrome

14. Installing and Configuring MySQL Server on Windows Server

Set up the popular open-source relational database.

Download MySQL Installer for Windows

# Visit the official MySQL website (dev.mysql.com/downloads/installer/).
# Download the MySQL Installer for Windows (e.g., mysql-installer-community-x.x.x.msi).
# Run the installer and choose 'Server only' or 'Custom' installation.
# Follow the wizard to configure root password and other settings.

Verify MySQL Service Status

Get-Service -Name MySQL*

15. Installing and Configuring PHP for IIS on Windows Server

Enable PHP applications to run on your IIS web server.

Download PHP for Windows

# Visit windows.php.net/download.
# Download the Non-Thread Safe (NTS) Zip package for your desired PHP version.
# Extract the contents to a directory like C:\php.

Configure IIS for PHP (Manual Steps)

# Open IIS Manager.
# Select your server name in the Connections pane.
# Double-click 'Handler Mappings'.
# Click 'Add Module Mapping...' in the Actions pane.
# Request path: *.php
# Module: FastCgiModule
# Executable: C:\php\php-cgi.exe (adjust path)
# Name: PHP_FastCGI
# Click OK.
# Also, set 'Default Document' to include 'index.php'.

More Windows Tutorials Coming Soon!

We are continuously adding more detailed guides for Windows Server management. Check back soon for topics like: Active Directory setup, DNS server, FTP server, VPN client setup, and many more!

About This Page

Welcome to your ultimate resource for mastering Virtual Private Servers! This platform is dedicated to providing clear, concise, and actionable tutorials for both Linux and Windows VPS environments. Whether you're a beginner setting up your first server or an experienced administrator looking for quick command references, our detailed documentation and copy-paste ready commands are designed to streamline your workflow. From deploying web applications and configuring databases to enhancing server security and setting up development environments, we've got you covered. Empower your VPS journey with GratisVPS.net!

Share This Resource

Help others discover these valuable VPS tutorials!

Frequently Asked Questions (FAQ)

What is a VPS server?

A Virtual Private Server (VPS) is a virtual machine sold as a service by an Internet hosting service. A VPS runs its own copy of an operating system (OS), and customers may have superuser-level access to that operating system instance, allowing them to install almost any software that runs on that OS.

What's the difference between Linux and Windows VPS?

Linux VPS runs on a Linux-based operating system (like Ubuntu, CentOS), typically used for web hosting, development, and custom applications due to its open-source nature and flexibility. Windows VPS runs on a Windows Server operating system, ideal for ASP.NET applications, MS SQL databases, and specific Windows-based software that requires a familiar graphical interface.

How do I connect to my Linux VPS?

You typically connect to a Linux VPS using SSH (Secure Shell). On Linux/macOS, you can use the terminal command `ssh username@your_vps_ip`. On Windows, you can use PuTTY or the built-in OpenSSH client in PowerShell/CMD.

How do I connect to my Windows VPS?

You connect to a Windows VPS using Remote Desktop Protocol (RDP). On Windows, search for 'Remote Desktop Connection'. On macOS, download 'Microsoft Remote Desktop' from the App Store. Enter your VPS IP address, username, and password to connect.

Are these tutorials suitable for beginners?

Yes, many tutorials are designed with beginners in mind, providing step-by-step instructions. However, some advanced topics may require basic familiarity with command-line interfaces or server concepts.

Can I use these commands on any Linux distribution?

Most Linux commands are universal, but package management commands (`apt`, `yum`, `dnf`, `pacman`) differ between distributions. Our Linux tutorials primarily focus on Debian/Ubuntu-based systems (`apt`). Always verify compatibility for your specific distribution.

What if a command doesn't work?

Ensure you have the necessary permissions (use `sudo`), that your system is updated (`sudo apt update && sudo apt upgrade`), and that there are no typos. If issues persist, consult the official documentation for the software or seek help from community forums.

How often are new tutorials added?

We strive to regularly update and add new tutorials to keep the content fresh and relevant. Check back frequently for the latest guides!

Is GratisVPS.net a hosting provider?

GratisVPS.net is a platform providing resources and tutorials related to VPS servers. While we offer guides on setting up various services, we are not a direct hosting provider.

Where can I find more help?

For specific issues, you can often find solutions on official documentation websites, Stack Overflow, Reddit communities like r/linuxadmin or r/sysadmin, or by contacting your VPS provider's support.