Firefox in Chrome - How I use Firefox with Docker to bypass school restrictions

Background

I know nothing about docker, proxies, and how to "kill" chrome extensions used by your school to restrict access to sites.

This is just something I found out about when playing around with ZimaOS, and I'm glad I did. It's easy, fast, and you can even add authentication, so nosey kids at school can't use the browser. Because this is just a VM of Firefox on your home network.

And you can set it up in minutes using Docker Compose and Cloudflared (cloudflare tunnels) or Tailscale to public expose it safely.

Why?

Short answer: Because I can.

Long answer: Because the so-called "laptops" my school gives out are (to put it nicely) horrible, they suck. They can't handle more than 5 tabs and are so slow it takes over 1 minute to restart, in that amount of time I can open VS Code, edit files, git push to @tangled.org (git pushes on tangled are slow) and update my website using @wisp.place on my Mac. So why not use the power of your home PC at school?

Setup

Before installing for the best experience please use a domain that you own that's managed by the Cloudflare Registrar, this way we can set up a Cloudflare tunnel to public expose the docker container safely.

A computer running Linux, preferably Debian based, based on my experience, Ubuntu Server works the best (Mac and Windows works, but for the best experience use Linux) with support for Docker and Docker Compose.

8GB of RAM, 32 GB of Storage (NVME SSD for the best experience), and a 2+ Core x86 Intel or AMD CPU (use a "modern" CPU for the best experience).

If you have a Domain that's not managed using Cloudflare you can use Tailscale which will give you a free public IP address, you don't even need to set up an exit node.

Learn more about Tailscale:

Notes - installing Tailscale on a Raspberry Pi - Daniel's Notes & Thoughts

Tailscale · Best VPN Service for Secure Networks

Terminal Tips:

When pasting from your clipboard into the terminal don't use CTRL+V use CTRL+SHIFT+V.

You can also use the UP key (up arrow)which will recall the previous command from your terminal's history.

You can use CTRL+C to cancel/force stop what the terminal is currently doing.

1 - Docker Setup

1A - Update your system

Update package list and install updates

sudo apt update && sudo apt upgrade -y

TIP: Use sudo (superuser do) when running commands as admin in the terminal

1B - Install docker

This installs Docker to your system

sudo apt install docker.io -y

TIP: Add -y at the end of a command to run it without needing to enter your password

1C - Install Docker install

This installs Docker Compose to your system

sudo apt install docker-compose -y

1D - Add your user to the docker group

This allows you to run Docker Commands without needing to add sudo at the start of the command

sudo usermod -aG docker $USER

1E - Apply the group change

newgrp docker

1F - Start Docker

sudo systemctl start docker

1G - Tell Docker to start on boot

This tells your system to start Docker after the system turns on

sudo systemctl enable docker

1H - Check to see if Docker is running

sudo systemctl status docker

2 - Create Container Directory

Create the directly (folder in simple terms) for the Docker Container and Docker config file.

2A - Create Directory

mkdir ~/firefox-docker

TIP: mkdir sands for Make Directory and can be run using md for short

2B - Navigate to the container's directory

cd ~/firefox-docker

TIP: cd stands for Change Directory and is used to enter a directory (a folder)

2C - Make sure you're in the right directory

pwd

TIP: pwd stands for Print Working Directory and is used to tell the user what directory they're currently in

3 - Get system information

This information will be needed in the feature, make sure to write it down

3A - Get User and Group ID

This will get your PUID (user id) and PGID (group) ID.

id

3B - Get timezone

timedatectl

4 - Create the Docker config file

Make the docker-compose.yml file that tells Docker what image to pull, ports to use, Environment variables, Dependencies, and more.

4D - Create the docker config file

Check If you're already in the firefox-docker directory, by running pwd. If the output is not firefox-docker run cd ~/firefox-docker.

nano docker-compose.yml

TIP: nano is a simple text editor that runs entirely in the current terminal session, very useful when editing config files without needing to leave the terminal

Edit config file

Once in the nano editor, paste the following

version: '3.8'

services:
firefox:
image: lscr.io/linuxserver/firefox:latest
container_name: firefox
environment:
- PUID=1000 # Change to your user ID
- PGID=1000 # Change to your group ID
- TZ=America/New_York # Change to your timezone
- CUSTOM_USER=myuser # Optional: set login username
- PASSWORD=mypassword # Optional: set login password
volumes:
- ./config:/config # Stores Firefox data persistently
ports:
- 6543:3000 # External:Internal port mapping
shm_size: "4gb" # Shared memory for browser stability
restart: always # Always restart container
security_opt:
- seccomp:unconfined # Better performance

Change the value of PUID and PGID with your PUID and PGID IDs you got in step 3A

Change the value of TZ with your timezone you got in step 3B

Change the value of CUSTOM_USER and PASSWORD to the username and password you want to use when accessing the browser. This is not required, meaning anyone with the link can use it. But it's highly recommended.

If you want to change the port the container is on, edit 6543 do not mess with the port 3000.

Once you're done editing your config file, press CTRL+X, then Y, then ENTER.

Start the Container

Pull linuxserver/firefox:latest

docker-compose pull

TIP: If you get an error about running as root, run using sudo

Start the container

docker-compose up -d

Check if it's running

docker-compose ps

or use

docker ps

Accessing your Firefox Container

Now that your Firefox container is running, you probably want to use it... right? First, we need to find our local IP Address.

Find your IP Address

hostname -I

or

ip addr show

or

ifconfig

Your IP Address should look something like this, 10.0.0.145 or 192.0.2.1. Once you find your local IP Address, you can visit 10.0.0.145:6543. Replace 10.0.0.145 with your IP Address and 6543 with the port you set. But as of now you can only access this on your home network, but you want to be able to access it anywhere.

I highly recommend using a Cloudflare Tunnel, if you don't have a Domain that's managed by the Cloudflare Registrar you can use the public IPV4 address given by Tailscale to access it.

If you want more types of these posts, @j4ck.xyz did a leaflet on how he uses Tailscale to bypass school restrictions