Setting Up Your First VPS: Beginner Guide
Practical guide to setting up your first VPS safely: SSH access, updates, firewall, web server, DNS, SSL, backups, monitoring and basic server security.
Introduction
A VPS gives you more control than shared hosting, but it also gives you more responsibility. With shared hosting, the provider usually manages the server environment. With a VPS, you may need to manage operating system updates, SSH access, firewall rules, web server setup, SSL certificates, backups and monitoring.
The goal is not only to make a website load. The goal is to prepare a stable, secure and recoverable server before hosting production websites, customer data or business services.
Quick answer
To set up your first VPS, update the operating system, secure SSH access, create a non-root sudo user, configure a firewall, install a web server, point DNS records, enable SSL, configure backups and set up monitoring. Do not move production sites before security, backups and recovery access are ready.
What is a VPS?
A VPS, or Virtual Private Server, is a virtual server with its own operating system, resources and configuration. You can install software, host websites, run applications, configure DNS-related services, manage firewall rules and control more of the server stack than on shared hosting.
A VPS can be used for:
- WordPress hosting
- static websites
- custom web applications
- staging servers
- APIs
- development environments
- small hosting setups
- control panel hosting
- mail-related infrastructure
- testing server configurations
A VPS is flexible because you control it. It is risky for the same reason if it is left unpatched, unmonitored or exposed to the internet without basic hardening.
Before you start
Before configuring a VPS, collect the basic access and project information.
You need:
- VPS IP address
- root password or SSH key access
- provider control panel access
- operating system name and version
- domain name
- DNS provider access
- preferred web stack
- backup destination
- recovery method from provider panel
- contact email for SSL certificates
- website or app requirements
Choose a supported operating system such as Ubuntu LTS, Debian stable, AlmaLinux or another system you know how to maintain.
Setup checklist
First VPS setup checklist
Use this checklist during initial server setup.
Connect by SSH
Log in using provider instructions and confirm recovery access.
Confirm OS version
Verify the installed operating system and version.
Update packages
Apply system updates before installing services.
Create non-root sudo user
Add a regular user with sudo privileges.
Configure SSH keys
Set up key-based login for the sudo user.
Confirm sudo access
Test sudo before changing SSH restrictions.
Configure firewall
Allow only required ports such as SSH, HTTP and HTTPS.
Set hostname
Use a clear hostname for administration and logs.
Set timezone
Match the server timezone to your project or region.
Install web server
Install Nginx, Apache, LiteSpeed or control panel stack.
Install database if needed
Add MySQL, MariaDB, PostgreSQL or other database.
Install PHP/runtime if needed
Install language runtimes required by your app.
Point DNS records
Set A, AAAA and CNAME records to the VPS.
Install SSL certificate
Enable HTTPS and automatic renewal.
Configure backups
Back up files, databases and configuration off-server.
Enable monitoring
Monitor uptime, SSL, disk, CPU, memory and services.
Test website status
Confirm the site loads over HTTPS with correct redirects.
Document important settings
Record users, paths, DNS, SSL and backup details.
Complete the basics before moving real production websites to the VPS.
Secure SSH
SSH is the main way to manage most Linux VPS servers. It should be secured early.
Recommended steps:
- use SSH keys where possible
- create a non-root sudo user
- confirm sudo access works
- disable direct root login only after testing the new user
- disable password login only after SSH keys are confirmed
- use strong passwords where passwords remain enabled
- limit SSH access if possible
- keep provider console access available for recovery
Do not disable root login or password login until you confirm your SSH key and sudo user work correctly. Otherwise, you can lock yourself out of the VPS.
Updates
A new VPS image can still include outdated packages. Update the system before installing websites or services.
sudo apt update
sudo apt upgrade -y
sudo dnf update -y
cat /etc/os-release
Keep the server updated regularly. Unpatched VPS servers are a common source of security issues.
Firewall
A firewall controls which services are reachable from the internet.
Common ports:
- 22 for SSH
- 80 for HTTP
- 443 for HTTPS
- 25 for SMTP only if running mail services
- 465/587 for authenticated SMTP only if running mail services
- 53 for DNS only if running DNS services
sudo ufw allow OpenSSH
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
sudo ufw enable
sudo ufw status
Allow SSH before enabling the firewall. Otherwise, you may block your own access.
Hostname
A clear hostname helps identify the server and is especially important if the VPS will send email or run server services.
Examples:
- server1.example.com
- web01.example.com
- vps01.example.com
hostnamectl
sudo hostnamectl set-hostname server1.example.com
timedatectl
sudo timedatectl set-timezone Europe/Chisinau
For mail servers, hostname and reverse DNS should be planned carefully. For normal web hosting, the hostname mainly helps administration and logs.
Web server
Most websites need a web server. Common choices include Nginx, Apache, LiteSpeed/OpenLiteSpeed or a control panel-managed stack.
Nginx
- popular for performance and reverse proxy setups
- common for modern VPS deployments
Apache
- widely supported
- common with traditional hosting and .htaccess workflows
Control panel
- easier for multiple websites, DNS, SSL and email
- adds resource usage and maintenance requirements
For beginners hosting multiple websites, a control panel may reduce management complexity. For developers, a manual Nginx/Apache setup may give more control.
DNS setup
To make a domain load from your VPS, point DNS records to the VPS IP.
Common records:
- A record for example.com to the VPS IPv4 address
- AAAA record if using IPv6
- CNAME for www to example.com or another hostname
- MX records only if email is hosted on this VPS
- TXT records for SPF, DKIM, DMARC or verification
If email is hosted with Google, Microsoft, Zoho or another provider, do not overwrite MX records when pointing the website to the VPS.
Check your domain and VPS signals
Use Domain Health Checker to review DNS, SSL, website status and related configuration before or after VPS setup.
SSL certificate
Public websites should use HTTPS. After DNS points to the VPS, install an SSL certificate.
Options:
- Let’s Encrypt
- Certbot
- hosting control panel SSL
- paid SSL certificate
- CDN-managed SSL
Check:
- certificate covers root domain
- certificate covers www if used
- certificate renews automatically
- HTTP redirects to HTTPS
- no mixed content appears
- certificate chain is valid
Use SSL Checker after setup to confirm validity, hostname match and expiration date.
Backups
Backups are required for any real VPS. A VPS can fail, be deleted, misconfigured, compromised or affected by user error.
Back up:
- website files
- databases
- uploaded media
- configuration files
- DNS notes
- SSL configuration
- application environment files
- control panel accounts if used
Best practices:
- store backups off-server
- automate backup schedule
- keep multiple restore points
- test restore process
- protect backup access
A backup stored only on the same VPS is not enough. If the server is lost, the backup may be lost too.
Monitoring
Monitoring helps you detect issues before users complain.
Monitor:
- website uptime
- HTTP status
- SSL expiration
- disk usage
- CPU load
- memory usage
- database service
- web server service
- backup success
- mail queue if mail is used
- security updates
- unusual traffic or login attempts
At minimum, monitor website status, SSL expiry and disk usage. A full disk is a common cause of website and database failure.
Email on a VPS
Running email on your first VPS is possible, but it is more complex than hosting a website.
Email requires:
- correct hostname
- reverse DNS
- SPF
- DKIM
- DMARC
- TLS for mail services
- clean IP reputation
- spam filtering
- abuse protection
- mail queue monitoring
- bounce handling
For beginners, using a dedicated email provider is often safer than running a full mail server on the first VPS. If you do run mail, check reverse DNS and email authentication carefully.
Common problems
Root login left exposed
HighDirect root login with password increases brute-force risk.
Next step: Create a sudo user, use SSH keys and restrict SSH carefully.
Firewall not configured
HighUnneeded services may be exposed to the internet.
Next step: Allow only required ports such as SSH, HTTP and HTTPS.
System not updated
HighOutdated packages may contain security vulnerabilities.
Next step: Apply updates and plan regular maintenance.
No backups
HighServer failure, mistakes or compromise can cause data loss.
Next step: Set automated off-server backups and test restore.
DNS points to wrong IP
MediumThe domain does not reach the VPS.
Next step: Check A, AAAA and CNAME records.
SSL not installed
MediumVisitors may see browser warnings or insecure connection messages.
Next step: Install SSL and enable automatic renewal.
No monitoring
MediumDowntime, disk usage or service failures may go unnoticed.
Next step: Monitor website status, SSL expiry, CPU, RAM and disk.
Too many services installed
MediumUnneeded services increase attack surface and resource usage.
Next step: Install only what the project actually needs.
Email configured casually
MediumPoor mail setup can cause spam folder placement or bounced messages.
Next step: Check rDNS, SPF, DKIM, DMARC and mail logs.
Production moved too early
HighThe server may not be secured, backed up or monitored yet.
Next step: Finish the setup checklist before migration.
How to set up your first VPS safely
-
Step 1: Choose a supported OS
Use a stable operating system with security updates.
-
Step 2: Connect by SSH
Log in using the provider instructions and confirm recovery access.
-
Step 3: Update packages
Update the system before installing website services.
-
Step 4: Create secure user access
Create a non-root sudo user and configure SSH keys.
-
Step 5: Configure firewall
Allow only required services such as SSH, HTTP and HTTPS.
-
Step 6: Install web stack
Install Nginx, Apache, database, PHP/runtime or a control panel.
-
Step 7: Point DNS
Set A, AAAA and CNAME records to the VPS where appropriate.
-
Step 8: Install SSL
Enable HTTPS and automatic certificate renewal.
-
Step 9: Configure backups
Back up files, databases and configuration to off-server storage.
-
Step 10: Enable monitoring
Monitor uptime, SSL, disk, CPU, memory and important services.
Example basic VPS setup flow
1. Order VPS
2. Choose Ubuntu LTS, Debian or AlmaLinux
3. Connect by SSH
4. Update packages
5. Create sudo user
6. Configure SSH keys
7. Allow SSH in firewall
8. Allow HTTP and HTTPS
9. Install Nginx or Apache
10. Point domain A record to VPS IP
11. Install SSL certificate
12. Upload website or deploy app
13. Create database if needed
14. Configure backups
15. Enable monitoring
16. Test website status and SSL
This is a simplified flow. Real setup depends on operating system, hosting provider, control panel, application stack and security requirements.
Useful starter commands
Check OS version:
cat /etc/os-release
Check server load:
uptime
Check disk usage:
df -h
Check memory:
free -m
Check listening ports:
sudo ss -tulpn
Check firewall status:
sudo ufw status
Check Nginx status:
systemctl status nginx
Check Apache status:
systemctl status apache2
Check recent system logs:
sudo journalctl -xe
Commands are illustrative and vary by operating system. Do not run commands you do not understand on production systems.
Frequently asked questions
Is a VPS good for beginners?
Yes, if you are ready to learn basic server management or use a managed VPS/control panel.
What should I do first after ordering a VPS?
Update the system, secure SSH, configure firewall, set backups and enable monitoring.
Do I need a control panel?
Not always. A control panel can make websites, DNS, SSL, email and backups easier, but it also adds resource usage and maintenance.
Is VPS faster than shared hosting?
Not automatically. A VPS must be configured, cached and monitored properly.
Can I host multiple websites on one VPS?
Yes, if the VPS has enough resources and the web server or control panel is configured correctly.
Can I host email on my VPS?
Yes, but email requires rDNS, SPF, DKIM, DMARC, spam protection and IP reputation management.
What is the biggest beginner mistake?
Moving production websites before securing, backing up and monitoring the VPS.
Related tools
Use these free tools to verify your configuration after applying changes.
Related guides
Browse all Hosting & VPS guides →Need help applying this fix?
Send us your domain, report link or issue details. CheckDomainHealth will review the request and route it to the right technical team if hands-on support is needed.
Was this guide helpful?
Your feedback helps us improve our guides for everyone.
Thanks for your feedback!