Your comprehensive guide to Linux and Windows server management.
Explore detailed guides for setting up and managing your Linux VPS.
Learn how to install Docker on Ubuntu and run your first containerized application.
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
docker run --name my-nginx -p 80:80 -d nginx
# Access Nginx at http://your_vps_ip
Install Apache, MySQL, and PHP to host dynamic websites.
sudo apt update
sudo apt install apache2 -y
sudo systemctl enable apache2 --now
sudo apt install mysql-server -y
sudo mysql_secure_installation
# Follow prompts to set root password, remove anonymous users, disallow root login remotely, etc.
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
Manage multiple Node.js versions easily using Node Version Manager (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
nvm install node
nvm use node
nvm alias default node
node -v
npm -v
Secure your VPS by configuring a simple firewall to control network access.
sudo apt update
sudo apt install ufw -y
sudo ufw default deny incoming
sudo ufw default allow outgoing
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
Set up Git for version control on your Linux VPS.
sudo apt update
sudo apt install git -y
git --version
git config --global user.name "Your Name"
git config --global user.email "[email protected]"
Set up the powerful open-source relational database PostgreSQL.
sudo apt update
sudo apt install postgresql postgresql-contrib -y
sudo systemctl enable postgresql --now
sudo -i -u postgres psql -c "ALTER USER postgres WITH PASSWORD 'your_new_password';"
# IMPORTANT: Replace 'your_new_password' with a strong password!
Set up a high-performance web server and reverse proxy.
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
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
Protect your server from brute-force attacks by banning malicious IPs.
sudo apt update
sudo apt install fail2ban -y
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
Create your own private VPN server for secure browsing.
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.
Enhance your terminal workflow with a powerful terminal multiplexer.
sudo apt update
sudo apt install tmux -y
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)
Automate free SSL/TLS certificates for your Nginx web server.
sudo apt update
sudo apt install certbot python3-certbot-nginx -y
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.
Set up the popular NoSQL database for your applications.
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
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
sudo apt update
sudo apt install -y mongodb-org
sudo systemctl enable mongod --now
sudo systemctl status mongod
Manage your MySQL/MariaDB databases via a web interface.
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
Automate repetitive tasks on your Linux server.
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.
crontab -l
Monitor your system's processes interactively.
sudo apt update
sudo apt install htop -y
htop
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!
Discover guides for installing software and configuring your Windows Server VPS.
Set up Internet Information Services to host websites on your Windows VPS.
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.
# 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.
Install a free edition of Microsoft SQL Server for database management.
# 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.
# 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.
Get Node.js and npm running on your Windows VPS for JavaScript development.
# 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).
node -v
npm -v
Allow incoming connections for your applications through Windows Firewall.
New-NetFirewallRule -DisplayName "Allow HTTP (Web Server)" -Direction Inbound -Action Allow -Protocol TCP -LocalPort 80
New-NetFirewallRule -DisplayName "Allow HTTPS (Secure Web Server)" -Direction Inbound -Action Allow -Protocol TCP -LocalPort 443
New-NetFirewallRule -DisplayName "Allow Custom App Port 5000" -Direction Inbound -Action Allow -Protocol TCP -LocalPort 5000
Set up Python for scripting and application development on your Windows VPS.
# 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.
python --version
pip --version
Install the cross-platform version of PowerShell for advanced scripting.
winget install --id Microsoft.PowerShell --source winget
# If winget is not installed, you might need to install App Installer from Microsoft Store.
pwsh -v
Allow standard users to connect via RDP.
Add-LocalGroupMember -Group "Remote Desktop Users" -Member "YourUsername"
# Replace "YourUsername" with the actual username you want to grant RDP access to.
Get-LocalGroupMember -Group "Remote Desktop Users"
Enable secure shell access to your Windows VPS.
Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0
Start-Service sshd
Set-Service -Name sshd -StartupType 'Automatic'
New-NetFirewallRule -DisplayName "OpenSSH (Port 22)" -Direction Inbound -Action Allow -Protocol TCP -LocalPort 22
Set up Git for version control on your Windows VPS.
# 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.
git --version
git config --global user.name "Your Name"
git config --global user.email "[email protected]"
Enable your Windows VPS to run .NET Core applications.
# 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.
dotnet --list-runtimes
Automate scripts or programs to run at specific times.
$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.
Get-ScheduledTask | Format-Table TaskName, State
Set up an alternative web server on your Windows VPS.
# 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.
# Open PowerShell as Administrator
cd C:\Apache24\bin
.\httpd.exe -k install -n "Apache2.4"
# Start the service
Start-Service Apache2.4
Simplify software installation on Windows with Chocolatey.
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).
choco install googlechrome
Set up the popular open-source relational database.
# 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.
Get-Service -Name MySQL*
Enable PHP applications to run on your IIS web server.
# 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.
# 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'.
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!
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!
Help others discover these valuable VPS tutorials!
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.
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.
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.
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.
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.
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.
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.
We strive to regularly update and add new tutorials to keep the content fresh and relevant. Check back frequently for the latest guides!
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.
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.