V-Server Setup
This page documents how I configured my very first cloud server instance in the Developer Akademie DevSecOps Course.
TOC
🖥️ V-Server Setup Guide
This documentation describes step-by-step how to configure your own Ubuntu-based V-Server – including SSH setup, NGINX web server, GitHub integration, and security best practices.
🔧 Requirements
- An Ubuntu server (e.g., from Hetzner, Netcup, AWS)
- SSH access to the server
- A GitHub account
📌 Step 1: SSH Key-Based Login
-
Generate an SSH key pair (on your local machine):
ssh-keygen -t ed25519 -
Copy your public key to the server:
ssh-copy-id user@server-ip -
Now connect to your server without a password:
ssh user@server-ip
🔒 Step 2: Disable Password Login
-
Open the SSH configuration file:
sudo nano /etc/ssh/sshd_config -
Change or add the following lines:
PasswordAuthentication no
PermitRootLogin no -
Restart SSH:
sudo systemctl restart ssh
✅ Make sure your SSH key login works before disabling password login!
🌐 Step 3: Install and Configure NGINX
-
Install NGINX:
sudo apt update
sudo apt install nginx -
Create a directory for your custom homepage:
sudo mkdir -p /var/www/myhomepage -
Create an HTML file:
Option A – Quick version with echo:
echo "Hello, NGINX! I have just configured our NGINX web server on Ubuntu Server!" | sudo tee /var/www/myhomepage/index.html
Option B – Manual edit with nano:
sudo nano /var/www/myhomepage/index.html
Example content:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>My NGINX Homepage</title>
</head>
<body>
<h1>Hello from my own homepage!</h1>
<p>This is a custom HTML page served by NGINX.</p>
</body>
</html>
-
Configure NGINX to serve the custom page:
sudo nano /etc/nginx/sites-available/defaultChange:
root /var/www/myhomepage;
index index.html; -
Restart NGINX:
sudo systemctl restart nginx
🧪 Test Your Setup
Open your browser and go to:
http://<your-server-ip>
✅ You should see your custom HTML page.
🔁 Step 4: Set Up Git and GitHub
-
Install Git (if not already installed):
sudo apt install git -
Configure Git with your name and email:
git config --global user.name "Your Name"
git config --global user.email "you@example.com"
🔐 Set up SSH Connection to GitHub (important!)
- Generate a new SSH key on the server (VM):
ssh-keygen -t ed25519 -C "your_email@example.com"
- Start the SSH agent and add the key:
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519
- Show your public key:
cat ~/.ssh/id_ed25519.pub
-
Now go to GitHub → Settings → SSH and GPG Keys → New SSH Key Paste the copied public key and give it a name (e.g., v-server).
-
Test the connection:
ssh -T git@github.com
You should see:
Hi your-username! You've successfully authenticated, but GitHub does not provide shell access.
-
Initialize a new Git repository:
git init
git add .
git commit -m "Initial commit" -
Push to GitHub:
git remote add origin https://github.com/YOUR-USERNAME/v-server-setup.git
git push -u origin main -
Create a new branch:
git checkout -b improved-readme -
Make changes, push the branch, and open a Pull Request ✅
📦 Summary
- ✅ Secure login using SSH key
- ✅ Password login disabled
- ✅ NGINX web server with custom homepage
- ✅ Git and GitHub integration completed