Self-host Huginn

Self-hosted system for building agents that read the web, watch for events and take actions, passing events between agents along a directed graph. Run your own Huginn on an always-on EnvHaven workspace by asking its coding agent: one request installs it, puts it on an HTTPS address and locks it down. What the agent takes care of, and the manual route.

Updated November 23, 2026

Running your own Huginn usually means a list of server chores: a machine that stays on, Docker or a runtime, a reverse proxy with certificates, a domain, and the settings that make Huginn behave behind all of it. On an EnvHaven workspace you skip the list. You ask the coding agent, and it does the work while you watch.

Just ask your agent

Open a Plus workspace (Huginn runs in Docker, which Plus and Pro include), tap Launch to start any coding agent (Claude Code, Codex, OpenCode or another), and ask it:

Set up Huginn on this workspace and give me the link. Follow https://envhaven.com/self-host/huginn.md

Then open the link it sends and create your Huginn account straight away, before anyone else finds the address. That is the whole request: the address in it is this page’s Markdown copy, and the agent follows the instructions for it further down, with every setting Huginn’s docs require.

Or keep it private with Tailscale

The preview URL puts Huginn on the public internet, which suits something other people need to reach. For an app only you and your household use, your tailnet is the better home: Tailscale gives Huginn an HTTPS address that only your own devices, signed in to your Tailscale account, can open. Save a Tailscale auth key in the workspace’s Vars pane as TS_AUTHKEY, and ask the agent:

Set up Huginn on my tailnet instead of the preview URL. Follow https://envhaven.com/self-host/huginn.md and https://envhaven.com/guides/self-host-privately-with-tailscale.md
  • A Tailscale container runs beside Huginn, so it keeps its private address through workspace restarts and updates, and every app you set up this way gets an address of its own.
  • Anything other services have to reach, such as a webhook, still needs a public address. Keep self-hosted apps private with Tailscale covers both, and what Tailscale’s free plan includes.
At a glance
What it isAutomation and workflows
LicenseMIT
Runs asDocker (ghcr.io/huginn/huginn)
Memory0.5 GB RAM plus 0.5 GB swap at least; 1 GB RAM plus 1 GB swap works with two Puma workers; 2 GB RAM recommended (docs)
Plan that fitsPlus or larger
Web port3000
Documentationgithub.com/huginn/huginn/blob/master/doc/docker/install.md

What your agent takes care of

  • Installing it. Huginn runs from the official image, ghcr.io/huginn/huginn, with its data in folders under ~/apps/huginn.
  • Putting it on an HTTPS address. The workspace’s preview URL serves it, and your own domain can too.
  • Locking it down first. What Huginn’s docs say to set before it faces the internet, below.
  • Telling you what to back up: the MySQL or PostgreSQL database (all agents, events and users) and /var/lib/mysql (volume of the built-in MySQL in the all-in-one image) (docs).

The settings it needs behind a proxy

  • DOMAIN: Domain the instance runs on, possibly with a port; the default localhost:3000 has to be changed to the real domain in production. (docs)
  • FORCE_SSL: Whether Rails forces all requests to use SSL; the docs say Huginn assumes it runs over SSL and that false stops the redirect to HTTPS. (docs)
  • rememberable_options: Devise setting in config/initializers/devise.rb: Remember me cookies are marked secure in production and are not sent over plain HTTP unless this is changed. (docs)

Before it faces the internet

  • The first admin password is random and printed once in the container log; choose your own with SEED_USERNAME and SEED_PASSWORD. The older Docker Hub page still says the seeded admin password is password. (docs)
  • INVITATION_CODE gates sign-ups and ships as try-huginn; the example file says to change it. (docs)
  • Set APP_SECRET_TOKEN from rake secret; in the single-process image a random one is generated at start when unset, which invalidates sessions whenever the container is recreated. (docs)
  • Leave ENABLE_INSECURE_AGENTS false unless everyone using the instance is trusted. (docs)

Things to ask next

Everything after the install is one more sentence to the agent. Some that come up:

  • “Build a workflow that posts each new GitHub issue in my repo to Slack.”
  • “Add the credentials it needs from my Vars pane, and test the workflow once.”
  • “Move Huginn to app.example.com.” Add the domain on the dashboard’s Domains page with a CNAME to domains.envhaven.app, and the agent changes Huginn’s address settings to match.
  • “Update Huginn to the latest release.” It pulls the new image and recreates the container, data kept.

Instructions for the agent

The agent reads these from the page’s Markdown copy. They also work pasted on their own, if you would rather give them in your own words.

Set up Huginn on this workspace and serve it at my preview URL.
- Use Docker Compose with the official image, ghcr.io/huginn/huginn, starting from the docs' compose file: https://github.com/huginn/huginn/blob/master/docker/single-process/docker-compose.yml. If `docker compose` is missing, install the Compose plugin into ~/.docker/cli-plugins first.
- The docs' setup includes: MySQL 8.4 or PostgreSQL (the all-in-one image starts a built-in MySQL when no database is linked); threaded worker container (same image running /scripts/init bin/threaded.rb) in the single-process compose files.
- Keep the compose file in ~/apps/huginn and all of its data in folders there (bind mounts, not named volumes), with restart: unless-stopped on every service.
- This server has no firewall, so publish no port on its public IP, and drop host networking and privileged mode from the docs' compose file. Docker runs on the host: connect this workspace to the compose network and relay my preview URL's port to Huginn's port 3000.
- The preview URL terminates HTTPS in front of Huginn: serve plain HTTP on its port, and trust the forwarded headers the relay passes on.
- Set what "The settings it needs behind a proxy" lists on https://envhaven.com/self-host/huginn.md for the preview URL, as Huginn's docs describe for running behind a proxy; skip any that apply only when Huginn serves HTTPS itself.
- Before the preview URL serves it, apply what "Before it faces the internet" lists on https://envhaven.com/self-host/huginn.md.
- When it answers at the preview URL, send me the link and tell me what to back up.
- If I asked for my tailnet instead of the preview URL, set Huginn up the same way but follow https://envhaven.com/guides/self-host-privately-with-tailscale.md for the network: no preview URL, no relay.

What to know

  • In Docker, Huginn’s containers keep running when the workspace restarts or updates. The relay from the preview URL is a process in the workspace, so after a restart or an update, ask the agent to restore it.
  • With less than the documented minimum memory, the Gemfile needs manual changes and the web interface can return internal server errors. (docs)
  • The all-in-one image keeps data in a built-in MySQL; without an exported volume or a linked database it cannot be updated without losing data. (docs)
  • Outbound email from production uses SMTP settings in the environment (SMTP_SERVER and SMTP_PORT in the example file) or sendmail. (docs)
  • Agents make outbound HTTP requests to any URL their owner sets; the Docker images bundle an egress proxy (Smokescreen) that can be switched on. (docs)
  • A workspace has one preview URL and one custom domain, both serving the same port, so it puts one app on a public address at a time.

Without a workspace

The manual route, on a server you run:

  1. Rent a Linux VPS, secure SSH, and create a user for the app.
  2. Install Docker and write a compose file from the official image.
  3. Put a reverse proxy in front (Caddy, nginx or Traefik), get certificates, and point a domain at the server.
  4. Set the proxy settings listed above for that domain, and pass WebSocket upgrades through the proxy if the app uses them.
  5. Keep the firewall closed except for the proxy, and schedule backups and updates.

Huginn’s own documentation covers each step for its install methods.

Sources

Facts about Huginn come from its own documentation, checked on 2026-11-23: