Host Your Website on Raspberry Pi

A tiny computer that runs your website 24/7 from home.

If you can follow a recipe, you can do this.

Don't know what to build? Try hosting file-social on your Pi — it's a personal media stream you can post to.

What You Need

  • 1. Raspberry Pi with WiFi (Zero W, Zero 2 W, 3, 4, 5, etc.)
  • 2. MicroSD card (8GB or bigger)
  • 3. Power cable (micro USB for Zero W, USB-C for newer)
  • 4. WiFi, with access to router settings
  • 5. Your computer (to set it up)

Step 1: Set Up Your Raspberry Pi

A. Install Raspberry Pi OS

  1. Download Raspberry Pi Imager
  2. Put the microSD card in your computer
  3. Open Imager → Choose OS → Raspberry Pi OS (other) → Raspberry Pi OS Lite (64-bit, newest option)
  4. Choose Storage → your microSD card
  5. Click the gear icon ⚙️ → fill in hostname, username, password, WiFi name & password, enable SSH
  6. Click Write → wait 5 minutes

⚠️ Step 5 is critical — basically every setting matters or it won't set up correctly.

B. Boot it up

  1. Put the microSD card in your Pi
  2. Plug in power
  3. Wait 2 minutes for it to start

C. Test the connection

  1. Open Terminal (Mac) or Command Prompt (Windows) on your computer
  2. Type: ssh username@hostname.local (use the username and hostname from step A5)
  3. Type "yes" if it asks about fingerprint
  4. Enter your password
  5. See a command prompt? It works!

If it doesn't connect, go back to step A and make sure you filled in all the settings correctly.

Step 2: Create Your Website

On your computer (not the Pi):

1. Make a folder on your Desktop called "mywebsite"

Right-click Desktop → New Folder → name it "mywebsite"

2. Create a file called "index.html" inside that folder

Open Notepad (Windows) or TextEdit (Mac), paste this, save it as "index.html":

<!DOCTYPE html> <html> <head> <title>My Website</title> </head> <body> <h1>Hello World!</h1> <p>This is my website.</p> </body> </html>

Step 3: Send Your Website to the Pi

Use rsync to copy your website folder to the Pi:

Sync your files

  1. Open Terminal (Mac) or Command Prompt (Windows) on your computer
  2. Type: rsync -avz ~/Desktop/mywebsite/ username@raspberrypi.local:/home/username/mywebsite/
  3. Replace username with your Pi username
  4. Replace raspberrypi.local with your Pi's hostname
  5. Press Enter, enter your password

💡 Every time you change your website, just run this command again to sync the changes.

Step 4: Start Your Website

SSH into your Pi and set up pm2 to run your web server (it auto-restarts on crashes and reboots):

Install pm2 and start the server

  1. SSH in: ssh username@raspberrypi.local
  2. Install Node.js and pm2: sudo apt update && sudo apt install -y nodejs npm && sudo npm install -g pm2
  3. Start the server: pm2 start "python3 -m http.server 8080" --name website --cwd ~/mywebsite
  4. Make it start on boot: pm2 startup (copy and run the command it shows)
  5. Save the process list: pm2 save

Useful commands: pm2 logs website (view logs), pm2 restart website (restart), pm2 stop website (stop)

Test it:

On your computer, open a browser and go to: http://raspberrypi.local:8080

(Replace raspberrypi.local with whatever hostname you used)

See "Hello World"? It works!

Step 5: Open a Door in Your Router

Right now only your home network can see it. Let's make it visible to everyone.

A. Find your Pi's address

In your SSH terminal, type: hostname -I

Write down the first number. Example: 192.168.1.50

B. Log into your router

  1. Go to 192.168.1.1 in a browser (or try 192.168.0.1)
  2. Username and password are usually:
    • admin / admin
    • admin / password
    • (or check the sticker on your router)

C. Add a rule

  1. Find "Port Forwarding" or "Virtual Server"
  2. Click "Add"
  3. Fill in:

    Name: MyWebsite

    External Port: 8080

    Internal IP: (your Pi's 192.168 number)

    Internal Port: 8080

    Protocol: Both

  4. Click Save

Test it:

  1. While SSH'd into your Pi, type: curl v4.ident.me → copy that number
  2. Go to http://YOUR-NUMBER:8080
  3. See "Hello World"? You're on the internet!

Step 6: Get a Real Website Address

Right now people have to type a weird number to visit. Let's give it a real name like yourname.proxie.social

1. Pick a name and sign up

Go here and choose a name. (Example: joe.proxie.social)

2. Connect it

Fill out the form:

Domain: yourname.proxie.social

IP Address: (the number from curl v4.ident.me)

Port: 8080

Click "Create Site"

Done!

Go to yourname.proxie.social in any browser. Your website is live.

Fix Dynamic IP (Optional but Recommended)

Home internet IPs change randomly, breaking your sites. Install the auto-updater to fix this automatically.

Important:

Run this on the machine that is hosting your sites. That may be this device or a different one. SSH into it first if needed.

Without this:

Your sites will randomly go down when your ISP changes your IP. You'll have to manually update each site.

One updater per server:

Install once on each physical server. It automatically updates ALL your sites on that server when the IP changes.

1. After creating your site on yxorp

Sign in and go to any site's details page

2. Copy the installer command

Look for the "Fix Dynamic IP" section with commands for both Linux/Mac and Windows

  • Linux/Mac/Pi: curl -sSL ...
  • Windows: irm ... | iex (run as Admin)

3. Run it on your server

Linux/Mac/Pi: Open Terminal (ssh if needed) on the device and paste the command
Windows: Open PowerShell as Administrator and paste

Note: Install on the machine hosting your sites (could be the same device you're on now). One installation per physical machine.

Done!

ALL your sites on this server will auto-update every 5 minutes. They stay online even when your ISP changes your IP.

Linux/Mac/Pi commands:

• View logs: tail -f ~/.yxorp/updater.log

• Uninstall: ~/.yxorp/updater.sh uninstall

Windows commands:

• View logs: Get-Content ~\.yxorp\updater.log -Tail 20

• Uninstall: Unregister-ScheduledTask -TaskName yxorp-updater -Confirm:$false; Remove-Item -Recurse -Force ~\.yxorp

What Can You Put On It?

  • • About you, your photos
  • • Art or writing you made
  • • Links to all your social media
  • • Whatever you want — it's yours

Edit your HTML files on your computer, then run the rsync command from Step 3 to sync changes to the Pi.

Things to Know

Keep the Pi running

Your website only works when the Pi is on. The good news: it uses almost no electricity (about $2/year).

If it stops working

Your internet number probably changed. Install the auto-updater above to fix this automatically, or SSH into your Pi and run curl v4.ident.me to get the new IP, then update it in yxorp.

Everyone can see it

This is public. Don't put passwords or private stuff on it.

Server not running?

SSH in and check with pm2 status. Restart with pm2 restart website. View logs with pm2 logs website.