Tutorials
Access Immich with Docker Compose
Add Femtoport to your existing Immich stack and connect from a browser or phone.
Give your Immich server a public HTTPS address by adding the Femtoport agent to its Docker Compose stack. You can then reach your photos from a browser or the Immich mobile app without opening a port on your router.
Before you start
This tutorial assumes Immich already works locally using its official Docker Compose setup. Open it locally and finish creating your administrator account before exposing it. If you have not installed it yet, follow Immich's Docker Compose installation guide first.
Have access to the stack's docker-compose.yml and .env files and a Femtoport account that can create tunnels. Public traffic needs workspace credit and active service access. The dashboard offers Buy credit and, when eligible, Free trial available → Activate free trial. Photo and video transfers consume traffic credit.
1. Create an Immich tunnel
- Open the Femtoport dashboard and sign in. Complete any account setup prompts.
- Choose Create new tunnel, then Web app or API. If prompted about credit, add credit or choose Set up tunnel anyway and return to credit before opening the public URL.
- Set Target URL to
http://immich-server:2283and choose Create tunnel. This is Immich's service name and internal port on the Compose network. Use your own service name if you changed it. - Copy the secret from the Agent token screen. You will pass it to the container below; you do not need to install the CLI on the host. Keep the token private: someone with it can connect an agent for this tunnel.
Use the assigned hostname as a complete address, such as https://YOUR_ASSIGNED_HOSTNAME/. Immich needs its own hostname root; it cannot be served under /immich. See Immich's reverse-proxy guidance.
2. Add the agent to Compose
In the existing Immich directory, create a separate file named femtoport.env containing this line, replacing the placeholder with the token you copied:
FEMTOPORT_AGENT_TOKEN=YOUR_AGENT_TOKEN
Restrict access with chmod 600 femtoport.env and keep it out of version control. Do not put the token in Immich's .env: the official Compose setup also passes that file to Immich containers. Do not publish the token or the output of commands that print the resolved Compose environment.
Add femtoport-agent under the existing top-level services: mapping in docker-compose.yml, and add its named volume under the existing top-level volumes: mapping. Merge these entries into those mappings; do not duplicate the mapping keys or replace Immich's other services and volumes.
services:
femtoport-agent:
image: registry.femtoport.com/agent:2
restart: unless-stopped
env_file:
- femtoport.env
volumes:
- femtoport-agent-data:/home/nonroot
volumes:
femtoport-agent-data:
With the official setup, both services join the same default network automatically. If you customized Immich's networks, attach the agent to the same network as immich-server. Inside the agent container, localhost refers to the agent itself, so keep the dashboard target as http://immich-server:2283.
The named volume preserves the agent's local state, including certificates when end-to-end encryption is enabled. Keep it across container updates. The agent needs outbound internet access; it needs no published ports, Docker socket mount, or host networking.
3. Start the agent
From the directory containing Immich's Compose files, run:
docker compose pull femtoport-agent
docker compose up -d femtoport-agent
These commands install and start the containerized agent alongside the existing Immich stack. Its restart policy keeps it running in the background. Return to the dashboard: the tunnel should change from Waiting for agent to Online.
4. Open Immich and connect your phone
Open the tunnel's assigned HTTPS URL from the dashboard. You should see Immich's sign-in page. Sign in with your existing Immich account and open a photo.
In the Immich mobile app, enter that same HTTPS address as the server endpoint, then sign in with your Immich credentials. Switch your phone to mobile data and upload a small photo to confirm access outside your home network. Confirm it appears in Immich before enabling a large backup.
Immich's own sign-in protects your library. Femtoport Basic auth adds another HTTP password prompt; leave it off for this walkthrough so mobile clients can use Immich's normal authentication. Do not expose an unfinished Immich installation or share your administrator credentials.
If it does not work
- Waiting for agent: run
docker compose ps femtoport-agentanddocker compose logs --tail=50 femtoport-agent. Check the token and outbound internet access. Keep secrets out of any logs you share. - Online, but Immich does not load: confirm Immich still works locally. Check that the dashboard target is
http://immich-server:2283, the service name matches your Compose file, and both containers share a network. - Browser works, phone does not: use the complete HTTPS hostname without
/immich, and check that Femtoport Basic auth is off. Confirm your Immich app and server versions are compatible. - Transfers fail: check workspace credit, service access, and any hold shown in the dashboard. Check Immich's logs and free disk space too. A successful small upload does not establish that a full video backup will complete; try a representative video before starting it.
Update or pause the connection
To update the installed agent image, rerun the two commands in Start the agent. Keep the named volume. Update Immich separately using its own upgrade instructions.
To stop public access while leaving Immich running locally:
docker compose stop femtoport-agent
Start it again with docker compose up -d femtoport-agent. You can also turn off Tunnel enabled in the dashboard. Avoid docker compose down -v: it can delete Immich's database and other named volumes as well as the agent's state.