Fundamentals 12 min read

Raspberry Pi Zero W: Installation, Configuration, and Basic Usage Guide

This article provides a step‑by‑step tutorial on understanding Raspberry Pi Zero W, preparing the hardware, flashing the Raspbian image, configuring SSH and Wi‑Fi, installing nginx, enabling remote access via ngrok, and optimizing the system for lightweight web hosting.

Architecture Digest
Architecture Digest
Architecture Digest
Raspberry Pi Zero W: Installation, Configuration, and Basic Usage Guide

Raspberry Pi (Chinese: 树莓派, abbreviated RPi) is a credit‑card‑sized Linux‑based micro‑computer designed for learning programming, with various models widely used by hobbyists and makers.

1. Personal understanding : It functions as a tiny host that can connect to a monitor, keyboard, mouse, USB drives, etc., offering many GPIO and serial ports for low‑level hardware access.

2. Market models : The most common is the 3‑generation B+ board, priced around 230 CNY, but a cheaper alternative around 100 CNY is the Raspberry Pi Zero W.

3. Raspberry Pi Zero W : A miniature version roughly one‑third the size of the 3 B+, featuring a 1 GHz single‑core CPU, 512 MB RAM, Wi‑Fi/BT chip, micro‑USB power and OTG ports, mini‑HDMI, CSI camera connector, 40‑pin GPIO, and a micro‑SD slot.

Key specifications:

BCM2835 processor, 1 GHz, 512 MB RAM

BCM43438 Wi‑Fi / BT chip

micro‑USB power interface

micro‑USB OTG interface

mini‑HDMI port

CSI camera interface

micro‑SD card slot for OS

40‑pin GPIO expansion header

Dimensions: 65 mm × 30 mm

4. More Raspberry Pi resources : Visit the Raspberry Pi Lab website for additional models and tutorials.

5. Installing the system on Zero W

5.1 Preparation : Required items include a 16 GB or 32 GB SanDisk micro‑SD card, a standard USB‑type‑A Android cable, SDFormatter, Win32DiskImager, and the Raspbian image (preferably the Lite version).

5.2 Download the image : After downloading the zip (≈360 MB), extract it to obtain a .img file (~1.7 GB).

5.3 Write the image (using Win32DiskImager): Insert the SD card, select the .img file, choose the device, and click “Write”.

5.4 Modify the boot partition :

Create an empty file named ssh (no extension) to enable SSH on first boot.

Create wpa_supplicant.conf with the following content to auto‑connect Wi‑Fi: country=CN ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev update_config=1 network={ ssid="your_wifi_name" psk="your_wifi_password" }

5.5 Assemble and power : Insert the SD card into the Zero W, connect power via the USB cable (5 V 1 A), and wait for the indicator LED to become steady.

5.6 Find the IP address (e.g., 192.168.0.104) from the router and SSH into the board using the default credentials (user: pi , password: raspberry ).

6. System optimization :

Replace default apt sources with a domestic mirror (e.g., USTC) by editing /etc/apt/sources.list and /etc/apt/sources.list.d/raspi.list , then run sudo apt-get update && sudo apt-get upgrade .

Set timezone to Asia/Shanghai using sudo dpkg-reconfigure tzdata .

Enable SSH on boot via sudo raspi-config (Interfacing Options → SSH) or by adding /etc/init.d/ssh start before exit 0 in /etc/rc.local .

7. Install nginx :

# Install
sudo apt-get install nginx
# Start
sudo /etc/init.d/nginx start
# Restart
sudo /etc/init.d/nginx restart
# Stop
sudo /etc/init.d/nginx stop

Access http:// your_pi_ip in a browser to verify the nginx welcome page.

8. Intranet penetration : Use tools like ngrok or frp to expose the local web service to the public internet. The author tested ittun and natapp ngrok clients on the Zero W; the ittun arm version worked.

Run ngrok in a screen session for background execution, though automatic startup on power loss remains unresolved.

9. Additional notes : The Zero W can run a lightweight website with nginx and ngrok, leaving about 250 MB RAM free and maintaining a CPU temperature of 37‑39 °C after two days of operation.

For more projects and tutorials, explore the Raspberry Pi Lab and other community resources.

LinuxNginxRaspberry PiSSHNgrokZero W
Architecture Digest
Written by

Architecture Digest

Focusing on Java backend development, covering application architecture from top-tier internet companies (high availability, high performance, high stability), big data, machine learning, Java architecture, and other popular fields.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.