Once you're connected to your new VPS, it's essential to perform basic system setup. This ensures better security, performance, and stability. This guide covers everything you should configure on a fresh Linux VPS (Ubuntu, Debian, CentOS, etc.): from updates and SSH settings to firewall, users, and backups.
1. Update the System
Install the latest security patches and package updates:
sudo apt update && sudo apt upgrade -y # For Ubuntu/Debian sudo dnf update -y # For CentOS/AlmaLinux
2. Create a Non-root User
Don't use the root account for daily tasks. Create a new user with sudo rights:
adduser adminuser usermod -aG sudo adminuser
3. Secure SSH Access
Disable root login and password authentication. Use SSH keys instead:
sudo nano /etc/ssh/sshd_config # Edit the following lines: PermitRootLogin no PasswordAuthentication no
Then restart SSH:
sudo systemctl restart sshd
4. Set Up a Firewall (UFW)
sudo apt install ufw sudo ufw allow OpenSSH sudo ufw enable sudo ufw status
For CentOS, use firewalld instead.
5. Enable Automated Backups
Use cron jobs to back up your databases, files, and config files. Example:
crontab -e 0 3 * * * /usr/local/bin/backup.sh
6. Install Monitoring Tools
Recommended tools for system monitoring:
htop— process monitoringvnstat— bandwidth usagelogwatch— log summarizer- Email alerts via
ssmtpormsmtp
Recommended Setup Sequence
- Update system packages
- Create a non-root user
- Secure SSH access
- Enable a firewall
- Configure backups and monitoring
← Back to Getting Started
Need help setting up your VPS? Contact Bit.Hosting support — we'll guide you through the process.
← Getting Started with VPS and Hosting