The
Mutable Net
About
The Project
〔←〕

Guide to building a Local Server
connected to a LibreMesh Network

This guide documents the process of turning a Raspberry Pi 4 into a web server accessible from within a LibreMesh mesh network. It is written for people with no prior experience using the Terminal or configuring network infrastructure. Every step is explained in plain language.

Definition 1
What is a Raspberry Pi?
A Raspberry Pi is a small, low-cost computer about the size of a credit card. It runs a full operating system, has USB ports, an ethernet port, HDMI output, and wireless networking. Unlike a regular computer, it is designed to be embedded inside projects. It has no screen or keyboard by default: you connect to it remotely from another computer. In this guide, the Raspberry Pi 4 Model B is used as a server: a machine that stores and delivers a website to anyone connected to the same network.
Definition 2
What is a Server?
A server is a computer that responds to requests from other computers. When you open a website in your browser, your computer is asking a server: "give me this page." The server sends it back. In this guide, the Raspberry Pi becomes that server: it holds the website files and delivers them to anyone connected to the same LibreMesh network when they type the right address in their browser.
Definition 3
What is a LibreMesh Network?
LibreMesh is an open-source firmware that turns commercial Wi-Fi routers into nodes of a mesh network. In a mesh network, every node communicates with the others, forming a distributed web of connectivity without a central point of control. When the Raspberry Pi joins this network, it becomes reachable by any device connected to any node in the mesh: phones, laptops, and other computers can all open the website it serves.
Definition 4
What is the Terminal?
The Terminal is a text-based interface for communicating with a computer. Instead of clicking icons, you type commands and the computer responds with text. It looks intimidating at first, but each command in this guide is explained step by step. You only need to type exactly what is shown and press Enter. On macOS, you can find the Terminal by searching "Terminal" in Spotlight (Cmd + Space).
Definition 5
What is SSH?
SSH (Secure Shell) is a way to connect to another computer remotely using the Terminal. Once connected via SSH, every command you type runs on the remote machine (in this case, the Raspberry Pi), as if you were sitting in front of it. This is how you will control the Pi throughout this guide, without ever connecting a screen or keyboard to it directly.
Definition 6
What is Nginx?
Nginx (pronounced "engine-x") is a web server program. It runs in the background on the Raspberry Pi, listens for requests from browsers on the network, and sends back the correct web page files. It is free, open-source, and widely used. You do not need to understand how it works internally. In this guide you will install it and configure it with a few commands.
What you will need
Materials
Hardware
  • Raspberry Pi 4 Model B (any RAM version, 2GB is sufficient)
  • MicroSD card, at least 16GB, Class 10 or faster
  • MicroSD card reader, to connect the SD card to your laptop
  • USB-C power supply, 5V/3A; the official Raspberry Pi charger is recommended
  • Ethernet cable, to connect the Pi to your laptop and later to the LibreMesh node
  • Ethernet to USB-A adapter, if your laptop does not have an ethernet port
  • A laptop or desktop computer running macOS or Windows, for the setup process
  • A LibreMesh node, a router already flashed with the LibreMesh firmware (see the Hacking Devices guide for how to do this)
Materials
Software
  • Raspberry Pi Imager, free download at raspberrypi.com/software
  • Your website files: the HTML, CSS, images, and other files that make up the site you want to serve
  • Terminal, built into macOS. On Windows use PowerShell or install Windows Subsystem for Linux
Task/01 — Prepare the SD Card
01
Download and open Raspberry Pi Imager

Go to raspberrypi.com/software and download the Raspberry Pi Imager for your operating system. Install it and open it. You will see three options: Device, Operating System, and Storage.

Insert your MicroSD card into your card reader and connect it to your laptop. It should appear as a drive on your computer.

02
Choose the operating system

Click Choose Device and select Raspberry Pi 4.

Click Choose OS. Select Raspberry Pi OS (other), then choose Raspberry Pi OS Lite (64-bit). This is a version without a graphical desktop: lighter, faster, and ideal for a server you will control remotely.

Click Choose Storage and select your MicroSD card. Be careful to select the right drive. Everything on it will be erased.

03
Customise the settings

Before writing the image, click the Edit Settings button (it may look like a gear icon or appear after clicking Next). A panel will open with several tabs.

Under General, set:

  • Hostname: type a name of your choice, for example myserver. This is how the Pi will identify itself on the network
  • Username: pi
  • Password: choose a password you will remember
  • Locale: set your timezone (e.g. Amsterdam or Rome) and keyboard layout (e.g. us)

Under Services, make sure Enable SSH is turned on, and select Use password authentication.

Leave the Wi-Fi section empty. You will connect the Pi via ethernet cable.

Click Save.

04
Write the image to the SD card

Click Next, then confirm when asked if you want to write to the card. The Imager will download the operating system and write it to your SD card. This takes approximately 5–10 minutes depending on your internet connection and card speed.

When it finishes, a message will confirm the write was successful. Remove the SD card safely from your laptop.

Task/02 — First Boot and SSH Connection
05
Boot the Raspberry Pi

Insert the MicroSD card into the Raspberry Pi. The card slot is on the underside of the board. Push it in gently until it clicks into place.

Connect one end of the ethernet cable to the Pi's ethernet port, and the other end to your laptop (using the adapter if needed).

Connect the USB-C power supply to the Pi. A small red LED will light up, followed by a green LED that will flicker as the system boots. Wait approximately 60–90 seconds for the Pi to fully start up.

06
Connect via SSH

Open the Terminal on your laptop. Type the following command and press Enter:

ssh pi@[your-hostname].local

Replace [your-hostname] with whatever hostname you chose in step 03.

The first time you connect, the Terminal will ask: "Are you sure you want to continue connecting?" Type yes and press Enter.

It will then ask for your password. Type the password you set in step 03. Note: as you type, nothing will appear on screen. This is normal for password entry in the Terminal. Press Enter when done.

If successful, the prompt will change to something like pi@myserver:~ $. This means you are now inside the Raspberry Pi, controlling it remotely from your laptop.

Note
If SSH does not connect

If the command returns an error like "Could not resolve hostname", the Pi may still be booting. Wait another 30 seconds and try again.

If it still does not work, you can find the Pi's IP address by checking your laptop's network settings. Look for a connection called "USB 10/100 LAN" or "Ethernet". The Pi should appear as the router or gateway address. Try: ssh pi@192.168.2.2 or ssh pi@192.168.1.1.

07
Update the system

Once connected via SSH, run the following two commands one at a time. Each one may take several minutes:

sudo apt update

sudo apt upgrade -y

The word sudo means "run this as an administrator." The apt commands manage software packages. update downloads the list of available updates, and upgrade installs them. The -y flag automatically answers "yes" to any prompts.

When finished, the prompt will return. The Pi is now up to date.

Task/03 — Install and Configure Nginx
08
Install Nginx

Still connected via SSH, type:

sudo apt install nginx -y

This installs the Nginx web server on the Pi. It will also automatically start running in the background and will restart itself every time the Pi is turned on.

To confirm it is running, type:

sudo systemctl status nginx

You should see the word active (running) in green. Press q to exit this view.

09
Create the website folder

Create a dedicated folder where your website files will be stored:

sudo mkdir -p /var/www/[your-website-name]

sudo chown pi:pi /var/www/[your-website-name]

The first command creates the folder. The -p flag creates any missing parent folders automatically. The second command changes the ownership of the folder to the user pi, which allows you to copy files into it later without permission errors.

10
Configure Nginx

Now tell Nginx where to find the website files. Type:

sudo nano /etc/nginx/sites-available/[your-website-name]

This opens a text editor called nano inside the Terminal. You will see a blank file. Type exactly the following:

server {
    listen 80;
    server_name _;
    root /var/www/[your-website-name];
    index landing.html index.html;
    location / {
        try_files $uri $uri/ =404;
    }
}

To save: press Ctrl + X, then Y, then Enter.

This configuration file tells Nginx: listen on port 80 (the standard web port), serve files from the folder you just created, and use landing.html as the default page when someone visits the address.

11
Activate the configuration

Run these commands to activate the configuration and restart Nginx:

sudo ln -s /etc/nginx/sites-available/[your-website-name] /etc/nginx/sites-enabled/

sudo rm /etc/nginx/sites-enabled/default

sudo nginx -t

sudo systemctl restart nginx

The first command creates a link to your configuration file in the "enabled" folder. Nginx only reads configurations that are enabled. The second removes the default placeholder page. The third checks your configuration for errors. The fourth restarts Nginx so it applies the new settings.

If nginx -t returns "syntax is ok" and "test is successful", everything is correct.

Task/04 — Transfer the Website to the Pi
12
Prepare to transfer files

Before copying the website files, make sure the Pi's website folder is writable by your user. In the SSH Terminal, type:

sudo chown -R pi:pi /var/www/[your-website-name]

Then type exit to close the SSH connection and return to your laptop's own Terminal.

13
Copy the website files

On your laptop's Terminal (not SSH; make sure the prompt shows your laptop's name, not [your-hostname]), navigate to where your website folder is and run the following command, replacing the path with the actual location of your site:

scp -r ~/path/to/your/website/* pi@[your-hostname].local:/var/www/[your-website-name]/

scp stands for Secure Copy. The -r flag copies entire folders recursively. The * means "everything inside this folder." The part after the colon is the destination path on the Pi.

You will be asked for the Pi's password. Type it and press Enter. You will see a list of files scrolling as they transfer. This may take several minutes depending on the size of your site.

14
Restore file permissions

After the transfer is complete, reconnect to the Pi via SSH:

ssh pi@[your-hostname].local

Then restore the correct permissions so Nginx can read the files:

sudo chown -R www-data:www-data /var/www/[your-website-name]

www-data is the user that Nginx runs as. By giving ownership to this user, you allow Nginx to access and serve all the files.

15
Test the server

On your laptop, open a browser and type:

http://[your-hostname].local

Your website should appear. If you see it, the server is working correctly. If you see a "403 Forbidden" error, the permissions may not have been applied. Go back and repeat step 14. If you see "404 Not Found", check that your site has a file called landing.html or index.html at the top level of the folder.

Task/05 — Connect the Pi to the LibreMesh Network
16
Connect the Pi's Wi-Fi to the mesh

Make sure your LibreMesh node is powered on and broadcasting its Wi-Fi network. The name will look something like LibreMesh.org/[your-network-name].

Connect to the Pi via SSH (while still connected via ethernet cable). Then run:

sudo rfkill unblock wifi

sudo nmcli radio wifi on

sudo nmcli dev wifi connect "LibreMesh.org/[your-network-name]"

Replace your-network-name with the actual name of your LibreMesh network. LibreMesh networks do not have a password by default, so no password is needed.

If the connection is successful, you will see: Device 'wlan0' successfully activated.

17
Find the Pi's mesh IP address

Once the Pi has joined the mesh, it will receive an IP address from the network. To find it, type:

ip addr show wlan0

Look for a line starting with inet followed by a number like [your-pi-ip]/16. This is the Pi's address on the LibreMesh network. Write it down.

From this point on, any device connected to the LibreMesh Wi-Fi can reach your server by typing this IP address in a browser. For example: http://[your-pi-ip]

Note
Keeping two connections at once

The Pi can be connected to both the ethernet cable (to your laptop) and the LibreMesh Wi-Fi at the same time. This is useful during setup: you SSH via ethernet while the Pi joins the mesh via Wi-Fi. Once setup is complete, you can SSH into the Pi using its mesh IP address instead, while connected to the LibreMesh Wi-Fi yourself.

Task/06 — Set a Human-Readable Address
18
Configure DNS on the LibreMesh node

Instead of remembering a numeric IP address, you can give the server a name (like [your-network-name].mesh) that anyone on the network can type in their browser.

This is done by configuring the DNS (Domain Name System) on the LibreMesh node itself. Connect to your laptop's Terminal and SSH into the node:

ssh root@thisnode.info

If this is the first time you connect, it will ask you to confirm the host key. Type yes. If you get a "host key has changed" error (this happens after a reset), run: ssh-keygen -R thisnode.info and try again.

The node does not have a password by default. If asked, just press Enter.

19
Add the DNS entry

Once inside the node, run these three commands, replacing the IP with the one you found in step 17:

uci add_list dhcp.@dnsmasq[0].address='/[your-network-name].mesh/[your-pi-ip]'

uci commit dhcp

/etc/init.d/dnsmasq restart

uci is the configuration tool used by OpenWrt and LibreMesh. The first command tells the node's DNS server to respond to the name [your-network-name].mesh with your Pi's IP address. The second saves the change permanently. The third restarts the DNS service so the change takes effect immediately.

Type exit to disconnect from the node.

20
Test the custom address

On a phone or laptop connected to the LibreMesh Wi-Fi, open a browser and type:

http://[your-network-name].mesh

Your website should appear. If it does not, try disabling and re-enabling Wi-Fi on your device to force it to use the network's DNS. On iPhone, you can also try opening the address in a Private/Incognito browser window to avoid cached results.

Note: the address [your-network-name].mesh only works on devices connected to this specific LibreMesh network. It does not work on the regular internet. It exists only within the mesh.

Task/07 — Updating the Website
21
Updating from a laptop on the mesh

Whenever you make changes to your website files on your laptop and want to update the server, connect your laptop to the LibreMesh Wi-Fi network, then open a Terminal and run:

First, restore write permissions so the files can be overwritten:

ssh pi@[your-pi-ip] "sudo chown -R pi:pi /var/www/[your-website-name]"

Then transfer the updated files:

scp -r ~/path/to/your/website/* pi@[your-pi-ip]:/var/www/[your-website-name]/

Finally, restore Nginx's read permissions:

ssh pi@[your-pi-ip] "sudo chown -R www-data:www-data /var/www/[your-website-name]"

Replace the IP address and folder path with your own values. After these three commands, the server will immediately serve the updated files.

22
Updating from a laptop via ethernet

If you are connected to the Pi directly via ethernet cable (not on the mesh), use [your-hostname].local instead of the IP address:

ssh pi@[your-hostname].local "sudo chown -R pi:pi /var/www/[your-website-name]"

scp -r ~/path/to/your/website/* pi@[your-hostname].local:/var/www/[your-website-name]/

ssh pi@[your-hostname].local "sudo chown -R www-data:www-data /var/www/[your-website-name]"

All three commands must be run in this order. Run them from your laptop's Terminal, not from inside an SSH session.

Note
Image file case sensitivity

One common issue when uploading a website built on macOS to a Linux server is image file extensions. On macOS, photo.JPG and photo.jpg are treated as the same file. On Linux, they are different. If your HTML references photo.jpg but the file is named photo.JPG, the image will appear broken on the server.

To fix this, SSH into the Pi and run:

cd /var/www/[your-website-name]

find . -type f \( -iname "*.JPG" -o -iname "*.PNG" -o -iname "*.GIF" \) | while read f; do dir=$(dirname "$f"); base=$(basename "$f"); newbase=$(echo "$base" | sed 's/\.\([A-Za-z]*\)$/.\L\1/'); [ "$base" != "$newbase" ] && sudo mv "$f" "$dir/$newbase"; done

Then update all references in the HTML and CSS files:

sudo find . -type f \( -iname "*.html" -o -iname "*.css" \) -exec sed -i -e 's/\.JPG/\.jpg/g' -e 's/\.PNG/\.png/g' -e 's/\.GIF/\.gif/g' {} \;

Task/08 — Shutting Down Safely
23
Shut down the Raspberry Pi

Never unplug the Raspberry Pi without shutting it down first. Cutting power while the system is running can corrupt the SD card, potentially destroying the operating system and requiring a full reinstall.

To shut down safely, connect via SSH and type:

sudo shutdown -h now

Wait 10–15 seconds until the green LED on the Pi stops flickering and goes dark. Only then is it safe to disconnect the power cable.

24
Shut down the LibreMesh node

Unlike the Raspberry Pi, LibreMesh router nodes do not require a software shutdown. They write data to flash memory in a way that is safe to interrupt. You can simply unplug the router directly.

Sources
References
 

"Raspberry Pi Documentation." Raspberry Pi Foundation. Accessed June 2026. raspberrypi.com/documentation.

"Nginx Beginner's Guide." Nginx. Accessed June 2026. nginx.org/en/docs/beginners_guide.html.

"LibreMesh Documentation." LibreMesh. Accessed June 2026. libremesh.org.

"UCI System." OpenWrt Documentation. Accessed June 2026. openwrt.org/docs/guide-user/base-system/uci.

"nmcli Reference Manual." NetworkManager. Accessed June 2026. networkmanager.dev.