Getting Started with Your VPS
A comprehensive guide to setting up and configuring your new VPS server
Introduction
Welcome to your new VPS! This guide will walk you through the initial setup and configuration of your virtual private server. By the end of this tutorial, youâll have a fully configured server ready for deployment.
Prerequisites
Before you begin, make sure you have:
- Access to your VPS credentials (sent via email)
- An SSH client installed on your computer
- Basic knowledge of command-line operations
Note: Password and SSH keys for the root account can be set in the VPS Admin Panel at panel.shrp.no (login via billing.shrp.no).
Step 1: Connect to Your VPS
First, you need to connect to your VPS using SSH.
On Linux/macOS
Open your terminal and run:
ssh root@your-server-ip
Replace your-server-ip with the IP address provided in your welcome email.
On Windows
You can use PuTTY or Windows Terminal with OpenSSH:
ssh root@your-server-ip
When connecting for the first time, youâll see a security warning. Type yes to continue.
Step 2: Update Your System
Once connected, update your system packages:
apt update && apt upgrade -y
This ensures you have the latest security patches and software versions.
Set Your Timezone
Configure the correct timezone to avoid confusion in server logs:
First, list available timezones:
timedatectl list-timezones
You can filter the list to find your region. For example, to find European timezones:
timedatectl list-timezones | grep Europe
Then set your timezone (example using Europe/Oslo):
timedatectl set-timezone Europe/Oslo
Or use the interactive tool:
dpkg-reconfigure tzdata
Verify the timezone:
timedatectl
Step 3: Create a New User
Running everything as root is not recommended. Letâs create a new user:
adduser yourusername
Follow the prompts to set a password and user information.
Grant Sudo Privileges
Add your new user to the sudo group:
usermod -aG sudo yourusername
Test Sudo Access
Before logging out of root, verify that sudo works for your new user:
su - yourusername
sudo whoami
This should return root. If it does, your sudo access is working correctly. Type exit to return to the root shell.
Step 4: Configure SSH Key Authentication
SSH keys are more secure than passwords. Hereâs how to set them up:
Generate SSH Key (on your local machine)
Important: Open a new terminal window on your computer (do not run this inside the VPS).
ssh-keygen -t ed25519 -C "your_email@example.com"
Copy the Key to Your Server
Still on your local machine, copy the key to your server:
ssh-copy-id yourusername@your-server-ip
Now you can log in without a password!
Now that you have SSH keys configured, proceed to the Secure Your VPS guide to disable password authentication and root login for enhanced security!
Step 5: Configure Firewall
Enable the firewall to protect your server:
ufw allow OpenSSH
ufw enable
Check the status:
ufw status
Next Steps
Congratulations! Your VPS is now set up with basic security. Here are some recommended next steps:
- Secure Your VPS - Enhanced security configurations
- Installing NGINX - Set up a web server
- Installing Docker - Install and configure Docker for containerization
- Install your preferred applications and services
Troubleshooting
Cannot Connect via SSH
If youâre having trouble connecting:
- Check that your server IP is correct
- Verify your SSH service is running:
systemctl status ssh - Check firewall rules:
ufw status
Forgot Your Password
You have several options to regain access:
- Reset via VPS Admin Panel: Login at billing.shrp.no and access the VPS Admin Panel at panel.shrp.no to reset your root password
- Use Console Access: Access your VPS through the web-based console available in the VPS Admin Panel to login locally
- Contact Support: Email our support team at shrp@shrp.no for assistance
Need Help?
If you encounter any issues or have questions:
- Join our Discord community
- Email us at shrp@shrp.no
- Check our other documentation guides