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 start the web server using screen (so it keeps running when you disconnect):

Run the server

  1. SSH in: ssh username@raspberrypi.local
  2. Type: cd mywebsite
  3. Type: screen -S website (this creates a "screen" session)
  4. Type: python3 -m http.server 8080
  5. Press Ctrl+A, then press D to "detach" (this leaves it running in the background)
  6. Type exit to close SSH — your website stays running!

💡 To check on it later: SSH back in and type screen -r website. To stop it: press Ctrl+C, then type exit.

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. In a new terminal on your computer, 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.

What Can You Put On It?

  • • About you, your photos
  • • Art or writing you made
  • • Photos to share with family
  • • 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. Run curl v4.ident.me and update it in yxorp.

Everyone can see it

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

Server crashes?

SSH back in, type cd mywebsite, then screen -S website, then python3 -m http.server 8080, then Ctrl+A D.

Pi reboots?

You'll need to manually restart the server after a reboot (SSH in and follow Step 4 again).