Introduction
In this follow-up guide, we'll transform your Raspberry Pi 4 into a powerful mobile development station that doubles as a WiFi access point. Building on our previous USB-C setup, we'll add a second WiFi interface, configure the built-in WiFi as an access point, and set up a complete development environment accessible from your iPad.
What We'll Achieve
By the end of this guide, you'll have:
- Dual WiFi Setup: USB WiFi adapter for internet connectivity + built-in WiFi as an access point
- Internet Sharing: Other devices can connect to your Pi's WiFi and access the internet
- Docker Environment: Container platform for running services
- Code-Server IDE: VS Code in your browser, accessible from your iPad
- GitHub Integration: SSH keys configured for seamless Git operations
Perfect for: Mobile development, on-the-go coding, providing WiFi hotspot, creating a portable dev environment
Prerequisites
- Raspberry Pi 4 with USB-C setup completed (see previous guide)
- SSH access to Pi via USB-C interface (critical - we'll be reconfiguring WiFi)
- USB WiFi adapter (I used the TP-Link AC1300 USB WiFi Adapter)
- iPad with terminal app (Terminus, Blink Shell, etc.)
⚠️ Important: Ensure you can SSH via USB-C before starting, as we'll be reconfiguring wireless interfaces!
Hardware Setup
Required Hardware
- Raspberry Pi 4 (any RAM variant)
- USB WiFi Adapter - AC1300 or similar dual-band adapter
- SD Card with Raspberry Pi OS
- iPad or laptop with USB-C
- USB-C cable (data + power)
Network Architecture
After setup, your Pi will have three network interfaces:
- usb0: USB-C connection to iPad/laptop (10.42.0.x network)
- wlan1: USB WiFi adapter connected to your home WiFi (internet source)
- wlan0: Built-in WiFi acting as Access Point (10.42.0.x network)
Step 1: Add and Configure USB WiFi Adapter
1.1 Install the USB WiFi Adapter
Plug your USB WiFi adapter into one of the Pi's USB ports. The adapter should be automatically recognized.
1.2 Identify the Adapter
# Check all network interfaces
iwconfig
# Or use ip command
ip link show
Your USB adapter will appear with a name like wlx5abbe3a7dd86 (based on its MAC address).
1.3 Create Persistent Interface Name
To ensure the interface name stays consistent across reboots, we'll create a udev rule.
Get the MAC address:
ip link show | grep wlx -A 1
Look for the line with link/ether - that's your MAC address (e.g., 5a:bb:e3:a7:dd:86).
Create udev rule:
sudo nano /etc/udev/rules.d/70-persistent-net.rules
Add this line (replace MAC address with yours):
SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="5a:bb:e3:a7:dd:86", NAME="wlan1"
Apply the rule:
sudo udevadm control --reload-rules
sudo udevadm trigger
sudo reboot
After reboot, your USB WiFi adapter should consistently appear as wlan1.
1.4 Remove Existing wlan0 Connections
Before configuring the new setup, remove any existing connections on the built-in WiFi card:
# List connections on wlan0
sudo nmcli connection show | grep wlan0
# Delete them (replace 'connection-name' with actual name)
sudo nmcli connection delete connection-name
1.5 Connect wlan1 to Your WiFi Network
Now configure the USB adapter to connect to your home WiFi for internet access:
sudo nmcli connection add \
ifname wlan1 \
type wifi \
ssid "YourWiFiName" \
wifi-sec.key-mgmt wpa-psk \
wifi-sec.psk "YourWiFiPassword" \
con-name my-wifi
Verify connection:
sudo reboot
After reboot, check connectivity:
# Check connection status
nmcli con show --active
# Test internet
ping -c 4 google.com
# Check IP address
ip addr show wlan1
If usb0 is configured with ipv4.method shared, your iPad should now also have internet access through the Pi.
Step 2: Configure wlan0 as Access Point
Now we'll turn the built-in WiFi (wlan0) into an access point that other devices can connect to.
2.1 Create Access Point
sudo nmcli con add \
type wifi \
ifname wlan0 \
con-name RaspberryPi-AP \
autoconnect yes \
ssid "RaspberryPi-AP" \
802-11-wireless.mode ap \
802-11-wireless.band a \
ipv4.method shared \
wifi-sec.key-mgmt wpa-psk \
wifi-sec.psk "12345678"
What this does:
- Creates an access point on
wlan0 - SSID:
RaspberryPi-AP - Password:
12345678 ipv4.method sharedenables DHCP server and NAT- Auto-connects on boot
2.2 Activate the Access Point
sudo reboot
2.3 Verify Access Point
After reboot:
# Check AP status
nmcli con show --active | grep RaspberryPi-AP
# Check wlan0 IP (should be 10.42.0.1)
ip addr show wlan0
# View connected clients
iw dev wlan0 station dump
2.4 Test from Another Device
On your phone or another device:
- Search for WiFi networks
- Connect to "RaspberryPi-AP"
- Enter password:
12345678 - You should get an IP like
10.42.0.x - Test internet connectivity
Step 3: Install Docker
Docker will host our code-server and other services.
3.1 Set Up Docker Repository
# Update package index
sudo apt update
# Install prerequisites
sudo apt install ca-certificates curl
# Create keyrings directory
sudo install -m 0755 -d /etc/apt/keyrings
# Add Docker's GPG key
sudo curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
# Add Docker repository
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
# Update package index again
sudo apt update
3.2 Install Docker
sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
3.3 Configure Docker Permissions
# Add docker group (may already exist)
sudo groupadd docker
# Add your user to docker group
sudo usermod -aG docker $USER
# Activate group changes
newgrp docker
3.4 Verify Installation
# Test Docker
docker run hello-world
# Check Docker version
docker --version
# Check Docker Compose
docker compose version
Step 4: Set Up Code-Server
Code-Server brings VS Code to your browser, making it perfect for iPad development.
4.1 Create Project Directory
mkdir -p ~/docker/code-server
cd ~/docker/code-server
4.2 Create Docker Compose File
nano docker-compose.yml
Paste the following:
services:
code-server:
image: lscr.io/linuxserver/code-server:latest
container_name: code-server
env_file:
- .env
volumes:
- ${CODE_SERVER_CONFIG_PATH}:/config
ports:
- "${CODE_SERVER_PORT}:8443"
restart: unless-stopped
Save and exit (Ctrl+X, Y, Enter).
4.3 Create Environment File
nano .env
Paste the following:
# User / Group
PUID=1000
PGID=1000
TZ=America/New_York
# Authentication
PASSWORD=YourSecurePassword
SUDO_PASSWORD=YourSecurePassword
# Code-server options
DEFAULT_WORKSPACE=/config/workspace
# Host configuration
CODE_SERVER_CONFIG_PATH=./config
CODE_SERVER_PORT=8443
Important: Change PASSWORD and SUDO_PASSWORD to something secure!
Save and exit.
4.4 Start Code-Server
docker compose up -d
4.5 Access Code-Server
From your iPad (connected via USB-C or WiFi):
- Open Safari or Chrome
- Navigate to:
https://rasp.local:8443(replaceraspwith your Pi's hostname) - Accept the self-signed certificate warning
- Enter your password
You should now see VS Code running in your browser!
Step 5: Configure GitHub SSH Keys
To use Git seamlessly from code-server, we'll set up SSH keys.
5.1 Generate SSH Key on Raspberry Pi
ssh-keygen -t ed25519 -C "your_github_email@example.com"
When prompted:
Enter file in which to save the key: /tmp/id_ed25519
Enter passphrase (empty for no passphrase): [Press Enter]
Enter same passphrase again: [Press Enter]
5.2 Copy Public Key
cat /tmp/id_ed25519.pub
Copy the entire output (starts with ssh-ed25519).
5.3 Add Key to GitHub
- Go to GitHub.com
- Click your profile → Settings
- Click SSH and GPG keys
- Click New SSH key
- Title: "Raspberry Pi Code-Server"
- Paste your public key
- Click Add SSH key
5.4 Move Keys to Code-Server
# Copy keys to code-server config
sudo cp /tmp/id_ed25519* ~/docker/code-server/config/.ssh/
# Set proper permissions
sudo chown -R 1000:1000 ~/docker/code-server/config/.ssh/
sudo chmod 600 ~/docker/code-server/config/.ssh/id_ed25519
sudo chmod 644 ~/docker/code-server/config/.ssh/id_ed25519.pub
# Clean up temporary keys
rm /tmp/id_ed25519*
5.5 Test GitHub Connection
Open code-server in your browser, then open the integrated terminal.
First, configure Git with your details:
git config --global user.name "github_username"
git config --global user.email "github_email_address"
Replace github_username with your GitHub username and github_email_address with your GitHub email.
Test SSH connection to GitHub:
ssh -T git@github.com
You should see:
Hi username! You've successfully authenticated, but GitHub does not provide shell access.
Success! You can now clone, push, and pull from GitHub repositories.
Step 6: Using Your Setup
From iPad via USB-C
- Connect Pi to iPad via USB-C cable
- Wait 30 seconds for connection
- Open browser:
https://rasp.local:8443 - Start coding!
From iPad via WiFi
- Connect to "RaspberryPi-AP" WiFi
- Open browser:
https://10.42.0.1:8443 - Start coding!
From Other Devices
Any device connected to "RaspberryPi-AP" can:
- Access the internet through the Pi
- Access code-server at
https://10.42.0.1:8443 - SSH to the Pi at
10.42.0.1
Network Topology
Internet
↓
[Home WiFi Router]
↓
[wlan1 - USB WiFi Adapter]
↓
[Raspberry Pi 4]
↓
├─→ [wlan0 AP] → Other WiFi devices (10.42.0.x)
└─→ [usb0] → iPad/Laptop (10.42.0.x)
Troubleshooting
WiFi Adapter Not Recognized
# Check USB devices
lsusb
# Check kernel messages
dmesg | grep -i wifi
# Manually load driver (if needed)
sudo modprobe 8812au # Example for Realtek chipsets
Access Point Not Visible
# Check wlan0 status
nmcli dev status | grep wlan0
# Restart connection
sudo nmcli con down RaspberryPi-AP
sudo nmcli con up RaspberryPi-AP
# Check AP channel
iw dev wlan0 info
# Check if AP mode is supported
iw list | grep -A 10 "Supported interface modes"
No Internet on Connected Devices
# Verify wlan1 has internet
ping -I wlan1 -c 4 google.com
# Check IP forwarding
cat /proc/sys/net/ipv4/ip_forward # Should return 1
# Enable if disabled
sudo sysctl -w net.ipv4.ip_forward=1
echo "net.ipv4.ip_forward=1" | sudo tee -a /etc/sysctl.conf
Code-Server Not Accessible
# Check if container is running
docker ps
# View logs
docker logs code-server
# Restart container
docker restart code-server
# Check port binding
sudo netstat -tulpn | grep 8443
SSH Keys Not Working
# Check permissions in container
docker exec -it code-server ls -la /config/.ssh
# Should show:
# -rw------- id_ed25519
# -rw-r--r-- id_ed25519.pub
# Fix permissions if needed
docker exec -it code-server chmod 600 /config/.ssh/id_ed25519
docker exec -it code-server chmod 644 /config/.ssh/id_ed25519.pub
Customization Tips
Change AP Password
sudo nmcli con modify RaspberryPi-AP wifi-sec.psk "NewPassword123"
sudo nmcli con down RaspberryPi-AP
sudo nmcli con up RaspberryPi-AP
Change AP SSID
sudo nmcli con modify RaspberryPi-AP 802-11-wireless.ssid "MyCustomSSID"
sudo nmcli con down RaspberryPi-AP
sudo nmcli con up RaspberryPi-AP
Set WiFi Channel
sudo nmcli con modify RaspberryPi-AP 802-11-wireless.channel 6
sudo nmcli con down RaspberryPi-AP
sudo nmcli con up RaspberryPi-AP
Install VS Code Extensions
In code-server:
- Click Extensions icon (left sidebar)
- Search and install extensions
- They'll persist in the config volume
Add More Docker Services
Add to docker-compose.yml:
services:
code-server:
# ... existing config ...
portainer:
image: portainer/portainer-ce:latest
container_name: portainer
ports:
- "9000:9000"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- portainer_data:/data
restart: unless-stopped
volumes:
portainer_data:
Use Cases
Mobile Development Workflow
- Connect iPad to Pi via USB-C
- Open code-server in Safari
- Clone your GitHub repository
- Code, test, commit, push
- All from your iPad!
Portable WiFi Hotspot
- Traveling with multiple devices
- Conference/event WiFi sharing
- Emergency internet sharing
- IoT project development
Learning Environment
- Practice Linux administration
- Learn Docker and containerization
- Experiment with networking
- Safe environment for testing
Security Considerations
Change Default Passwords
# Update code-server password in .env
nano ~/docker/code-server/.env
# Change PASSWORD and SUDO_PASSWORD
# Restart code-server
cd ~/docker/code-server
docker compose down
docker compose up -d
Use Strong WiFi Password
# Use at least 12 characters with mixed case, numbers, symbols
sudo nmcli con modify RaspberryPi-AP wifi-sec.psk "MyStr0ng!P@ssw0rd"
Enable Firewall (Optional)
sudo apt install ufw
sudo ufw allow 22/tcp # SSH
sudo ufw allow 8443/tcp # Code-server
sudo ufw enable
Regular Updates
# Update Pi OS
sudo apt update && sudo apt upgrade -y
# Update Docker images
cd ~/docker/code-server
docker compose pull
docker compose up -d
Performance Tips
Monitor Resources
# Check CPU/Memory
htop
# Check temperature
vcgencmd measure_temp
# Check WiFi signal
iwconfig wlan1 | grep -i signal
Optimize for iPad
In code-server settings:
- Enable auto-save
- Reduce editor font size if needed
- Use split view for multitasking
- Install keyboard shortcuts extension
Conclusion
You now have a fully functional mobile development environment powered by your Raspberry Pi! This setup gives you:
✅ Portable WiFi access point for multiple devices
✅ Professional IDE accessible from iPad
✅ Full Git integration with GitHub
✅ Docker environment for running services
✅ All powered by a single USB-C cable
This configuration is perfect for mobile developers, digital nomads, students, or anyone who wants a powerful, portable development environment.
Next Steps
- Explore VS Code extensions for your workflow
- Set up additional Docker services (databases, web servers, etc.)
- Configure custom domains with mDNS
- Add more storage with USB drives
- Experiment with IoT projects
Additional Resources
- Previous Guide: Raspberry Pi USB-C Setup
- NetworkManager Documentation
- Code-Server Documentation
- Docker Documentation
- GitHub SSH Documentation
Changelog
- 2026-01-24: Initial release
Questions or issues? Open an issue on GitHub or leave a comment below!
Found this helpful? Star the repository and share with others!
Comments
Post a Comment