Have you ever wondered if it’s possible to host your own website securely—right from your home—without spending a dime on hosting? The answer is yes, and in this detailed guide, I’ll walk you through setting up a self-hosted website using open-source tools and hardware you probably already own.
We’ll go step-by-step through setting up an Ubuntu server, configuring Apache, enabling HTTPS with SSL encryption, connecting a custom domain, and remotely managing it all via SSH. If you’re in the U.S. and looking to start your own personal site, blog, dashboard, or test server—this guide is perfect for you.

🔧 What You’ll Need
- A PC or laptop to act as your server (or a VM)
- Ubuntu Server ISO (download from ubuntu.com)
- Internet connection with a router that allows port forwarding
- A domain name from any provider (we’ll use IONOS as an example)
- Patience and curiosity!
🧱 Step 1: Create the Server (VM or Bare Metal)
You can run your server in a VM (Proxmox, VirtualBox, VMware) or install Ubuntu Server directly on a machine (bare metal). In this guide, we’ll use Proxmox.
VM Setup in Proxmox:
- Name your VM:
web-server - Mount Ubuntu Server ISO
- Set:
- 20GB storage
- 2 CPU cores
- 4GB RAM
- Leave network card default, then start VM
💻 Step 2: Install Ubuntu Server
During Installation:
- Select your language and keyboard
- Configure network interface:
- Use manual IPv4 setup
- Example IP:
10.10.10.110 - Subnet:
255.255.255.0 - Gateway:
10.10.10.1 - DNS:
8.8.8.8or1.1.1.1
- Set your hostname, username, and password
- Skip Ubuntu Pro and server snaps
- Do not install OpenSSH yet (we’ll do it after)
Once installation completes, reboot the VM and login.
🆙 Step 3: Update the Server
Run these commands:
sudo apt update
sudo apt upgrade -y
🌐 Step 4: Install Apache Web Server
Install Apache:
sudo apt install apache2 -y
After installation, your site is now accessible via http://your-local-ip, but only inside your home network.
🚪 Step 5: Port Forwarding for Internet Access
To make your website accessible publicly:
- Log in to your router (usually
192.168.0.1or10.0.0.1) - Go to Port Forwarding
- Add two rules:
- HTTP: Port 80 →
IP of your server(e.g., 10.10.10.110) - HTTPS: Port 443 → Same IP
- HTTP: Port 80 →
Now if you access your public IP address, your website will be visible globally.
🔎 Find your public IP using WhatIsMyIP.com
🌍 Step 6: Set Up Your Custom Domain (A Record)
Head to your domain provider (e.g., IONOS) and:
- Go to DNS settings
- Create an A Record
- Name:
www - Value: Your public IP
- Name:
- Wait for DNS propagation (can take up to 30 minutes)
📝 Step 7: Configure Apache for Your Domain
Edit Apache’s config file:
sudo nano /etc/apache2/sites-available/000-default.conf
Inside the <VirtualHost *:80> block, add:
ServerName yourdomain.com
Save and exit (CTRL+O, Enter, CTRL+X), then reload Apache:
sudo systemctl reload apache2
🔒 Step 8: Add SSL with Let’s Encrypt (Certbot)
SSL is essential for HTTPS and modern browser compatibility.
- Install Certbot:
sudo apt install certbot python3-certbot-apache -y
- Run Certbot to auto-configure SSL:
sudo certbot --apache
- Follow the prompts:
- Choose your domain
- Certbot will install your SSL certificate
Your site is now accessible securely via https://yourdomain.com.
🔐 Step 9: Enable Secure SSH Access with Key-Based Login
SSH allows remote management of your server securely.
1. Install OpenSSH Server:
sudo apt install openssh-server -y
Check if it’s running:
sudo systemctl status ssh
2. Generate SSH Key on Your Main Machine:
On your PC/macOS/Linux system:
ssh-keygen
Press Enter to accept defaults. Optionally add a passphrase.
3. Transfer SSH Key to Server:
ssh-copy-id yourusername@your-server-ip
Or manually:
scp ~/.ssh/id_rsa.pub youruser@serverip:/home/youruser/
Then on server:
mkdir ~/.ssh
mv id_rsa.pub ~/.ssh/authorized_keys
chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys
Now SSH in:
ssh yourusername@your-server-ip
No password required, just your passphrase.
🛡️ Your Server is Now Secure & Publicly Accessible
You now have:
- ✅ A self-hosted Apache web server
- 🔒 HTTPS encryption via Let’s Encrypt
- 🌐 Custom domain configured
- 🔑 SSH remote access with key authentication
This is an excellent foundation for future projects—host a blog, dashboard, photo gallery, or even a self-hosted tool like Jellyfin or Nextcloud.
🙋 Frequently Asked Questions
Q: Is it legal to host a website from home in the U.S.?
Yes, as long as you’re not violating your ISP’s terms or hosting illegal content.
Q: Can I use a Raspberry Pi for this?
Absolutely! It’s perfect for low-traffic personal sites.
Q: Do I need a static IP?
Not required, but using dynamic DNS (e.g., DuckDNS) is recommended if your IP changes frequently.
Q: What if I want to host multiple websites?
You can use Apache’s virtual hosts to handle multiple domains.
🧰 Recommended Homelab Hardware (Amazon Affiliate Links)
If you’re expanding your HomeLab, here’s some great gear to consider:
- 🧩 TP-Link PoE Switch
- 🍓 Raspberry Pi 5 Kit
- 🔌 USB for OS Imaging
- 🌐 Linksys 16-Port Unmanaged Switch
- 🛡️ MikroTik hEX Router
- 📡 Ubiquiti U6+ WiFi 6 AP
- 📏 Cat6 Ethernet Cable Pack
- 🧵 Cable Management Velcro Straps
🏷️ Tags
self-hosted web server, host website from home, apache ssl setup, ubuntu server tutorial, certbot ssl guide, ssh key authentication, homelab web hosting, port forwarding setup, domain dns configuration
📣 Hashtags
#SelfHosted #UbuntuServer #ApacheWebServer #HTTPS #SSHLogin #HomeLabUSA #LetsEncrypt #FreeWebsiteHosting #LinuxWebHosting #HostYourOwnWebsite