Portainer Templates logo

Portainer Templates

Firefox (stack) Firefox (stack)

Browsers

Firefox Browser, also known as Mozilla Firefox or simply Firefox, is a free and open-source web browser developed by the Mozilla Foundation and its subsidiary, the Mozilla Corporation. Firefox uses the Gecko layout engine to render web pages, which implements current and anticipated web standards.

Configuration

Type
Compose
Platform
linux
Image
ghcr.io/linuxserver/firefox
Ports
3456:3000
Volumes
/config : /portainer/Files/AppData/Config/firefox
Env vars
PUID=1026PGID=100TZ=Europe/Athens
Restart
unless-stopped
Source

Template by xneo1·Source

Installation

  1. Ensure both Docker and Portainer are installed, and up-to-date
  2. Log into your Portainer web UI
  3. Under Settings → App Templates, paste the below URL
  4. Head to Home → App Templates, and the list of apps will show up
  5. Select the app you wish to deploy, fill in any config options, and hit Deploy

Template Import URL

https://raw.githubusercontent.com/Lissy93/portainer-templates/main/templates.json
Show Me demo

docker run -d --name firefox \
  -p 3456:3000 \
  -e 'PUID=1026' \
  -e 'PGID=100' \
  -e 'TZ=Europe/Athens' \
  -v /portainer/Files/AppData/Config/firefox:/config \
  --restart=unless-stopped \
  ghcr.io/linuxserver/firefox

If the stack expects env vars, set them or add them to a .env file first.

volumes:
  firefox:

services:
  firefox:
    image: ghcr.io/linuxserver/firefox
    container_name: firefox
    environment:
      - PUID=1026 #change this to for your settings
      - PGID=100 #change this to for your settings
      - TZ=Europe/Athens  #change this to for your location
    volumes:
      - /portainer/Files/AppData/Config/firefox:/config
    ports:
      - 3456:3000
    shm_size: "1gb"
    restart: unless-stopped

Or, use the original compose file, straight from the template repo. Deploy with:

git clone https://github.com/xneo1/portainer_templates
cd portainer_templates
docker compose -f Template/Stack/firefox.yml up -d

Save this file as firefox-stack-stack.yml, then from a manager node, run docker stack deploy -c firefox-stack-stack.yml firefox-stack

version: '3.8'
services:
  firefox-stack:
    image: ghcr.io/linuxserver/firefox
    ports:
      - '3456:3000'
    volumes:
      - /portainer/Files/AppData/Config/firefox:/config
    environment:
      PUID: '1026'
      PGID: '100'
      TZ: Europe/Athens
    deploy:
      restart_policy:
        condition: any

Save each file below into a folder, then run kubectl apply -f .
Written for k3s, but works on any cluster: bind mounts use hostPath, named volumes get a persistent volume claim, and ports are exposed via a LoadBalancer service.

firefox-stack-deployment.yaml

apiVersion: apps/v1
kind: Deployment
metadata:
  name: firefox-stack
  labels:
    app: firefox-stack
spec:
  replicas: 1
  selector:
    matchLabels:
      app: firefox-stack
  template:
    metadata:
      labels:
        app: firefox-stack
    spec:
      containers:
        - name: firefox-stack
          image: ghcr.io/linuxserver/firefox
          env:
            - name: PUID
              value: '1026'
            - name: PGID
              value: '100'
            - name: TZ
              value: Europe/Athens
          ports:
            - containerPort: 3000
              protocol: TCP
          volumeMounts:
            - name: firefox-stack-data-0
              mountPath: /config
      volumes:
        - name: firefox-stack-data-0
          hostPath:
            path: /portainer/Files/AppData/Config/firefox

firefox-stack-service.yaml

apiVersion: v1
kind: Service
metadata:
  name: firefox-stack
spec:
  type: LoadBalancer
  selector:
    app: firefox-stack
  ports:
    - name: 3456-tcp
      port: 3456
      targetPort: 3000
      protocol: TCP

Save this file as ~/.config/containers/systemd/firefox-stack.container

[Unit]
Description=Firefox (stack)

[Container]
Image=ghcr.io/linuxserver/firefox
ContainerName=firefox-stack
PublishPort=3456:3000
Environment=PUID=1026
Environment=PGID=100
Environment=TZ=Europe/Athens
Volume=/portainer/Files/AppData/Config/firefox:/config

[Service]
Restart=always

[Install]
WantedBy=default.target

Then reload systemd and start the service:

systemctl --user daemon-reload
systemctl --user start firefox-stack

For a system-wide service, use /etc/containers/systemd/ and drop --user.

For more installation options, see the Documentation in our GitHub repo

Serve Firefox (stack) on your own domain behind Caddy, Nginx or Traefik. Fill in your domain and copy the result. It's a starting point, some apps need their own base URL or extra headers set too.

Proxying firefox-stack.example.com to http://firefox:3000

Add this to your Caddyfile

firefox-stack.example.com {
	reverse_proxy http://firefox:3000
}

Check the logs first

Nine times out of ten the logs tell you exactly what went wrong.

  • In Portainer, go to Containers, click the container, then Logs. Or run docker logs <container>
  • Exit codes help too: 137 means killed, usually out of memory. 126 or 127 means the command inside the image is broken.

Port already in use

If deployment fails with "Bind for 0.0.0.0:3456 failed: port is already allocated", something else on your server is using that port.

  • Find what's using it: sudo ss -tlnp | grep :3456
  • Stop the other service, or pick a different host port. In 3456:3000 only the left number is yours to change, the right one belongs to the app.

Running but the page won't load

The container is up but nothing appears in your browser.

  • Use your server's real IP: http://your-server-ip:3456. The 0.0.0.0 link Portainer shows isn't a real address.
  • Give it a minute after first deploy, firefox can take a while to initialise.
  • Make sure your firewall allows the port, e.g. sudo ufw allow 3456

Permission denied on volumes

If the logs show "permission denied", the app can't write to its data folder on the host.

  • Fix the ownership: sudo chown -R 1026:100 /portainer/Files/AppData/Config/firefox
  • Or set the PUID and PGID variables (defaults 1026:100) to match your own user, found with id $USER

Image won't pull

Test the pull directly on the host: docker pull ghcr.io/linuxserver/firefox

  • "manifest unknown" means the tag no longer exists. This template uses latest, so try pinning a specific version instead.
  • "toomanyrequests" is the Docker Hub rate limit. Log in with docker login to raise it.
  • "no space left on device" means a full disk. Reclaim space with docker system prune

"exec format error"

This means the image was built for a different CPU architecture than your server.

  • Check yours with uname -m: x86_64 is amd64, aarch64 is arm64. Raspberry Pi and other ARM boards are the usual culprits.

Container keeps restarting

The unless-stopped restart policy relaunches the app after every crash, so the real error can scroll past.

  • Check the logs right after a restart, the last few lines before it died are the useful ones.
  • Get the exit code with docker inspect <container> --format '{{.State.ExitCode}}'
  • Still stuck? Redeploy once with the restart policy set to no so the failure stays visible.

Stack won't deploy

Compose stacks fail fast on small mistakes, and Portainer shows the reason just above the editor.

  • YAML only accepts spaces for indentation, a single tab breaks the whole file.

Raise an issue

Found something which isn't working as it should? Here's how to report it.