Log inSign up

Infisical for team secrets and environment variables

Download the official docker-compose.prod.yml and the example .env, fill in a fresh ENCRYPTION_KEY, AUTH_SECRET, database password and SITE_URL, bind the web port to 127.0.0.1:8080 and run docker compose up -d. Publish secrets.example.net through Caddy or Nginx with HTTPS, create the first admin account, and let your applications pull their variables with infisical run.

Topic: Self-hosted apps · Tested on: Ubuntu 24.04 and 22.04, Debian 12 and 13 · Updated 2026-12-03

What do you need to self-host Infisical?

You need Docker Engine with the Compose plugin, around 2 GB of memory and a hostname. The stack is three containers: the Infisical application, PostgreSQL and Redis.

  • Server: Ubuntu 24.04 or Debian 12/13 with Docker installed as in Docker Engine, or the Docker app image which ships it ready.
  • DNS: secrets.example.net pointing at 198.51.100.24 (and the IPv6 address if you use it).
  • Mail: SMTP credentials for invitations and email verification. Infisical works without mail for a single admin, but inviting a team needs it.

Infisical differs from Vault and OpenBao in focus: it is built around projects and environments (development, staging, production) with a friendly web UI, which suits teams that mostly need shared .env values.

How do you download the Compose files?

Fetch the production Compose file and the environment template from the project repository into their own folder.

sudo mkdir -p /opt/infisical && cd /opt/infisical
sudo curl -fsSL -o docker-compose.prod.yml \
  https://raw.githubusercontent.com/Infisical/infisical/main/docker-compose.prod.yml
sudo curl -fsSL -o .env \
  https://raw.githubusercontent.com/Infisical/infisical/main/.env.example
ls -la

Read the Compose file before you run it. It references an image tag; for predictable upgrades, replace a floating tag with a specific release version listed in the project changelog.

Which settings must you change in .env?

Generate new secrets and set the public address; the example values are public and must never reach production.

openssl rand -hex 16       # ENCRYPTION_KEY
openssl rand -base64 32    # AUTH_SECRET
openssl rand -hex 20       # database password
sudo nano /opt/infisical/.env

Update at least these lines:

ENCRYPTION_KEY=paste-32-hex-characters
AUTH_SECRET=paste-base64-value
POSTGRES_PASSWORD=paste-database-password
DB_CONNECTION_URI=postgres://infisical:paste-database-password@db:5432/infisical
SITE_URL=https://secrets.example.net

Keep the user and database names consistent across POSTGRES_USER, POSTGRES_DB and the connection string. Store ENCRYPTION_KEY outside the server as well: secrets in the database are encrypted with it, and a lost key means lost secrets. Restrict the file with sudo chmod 600 .env.

How do you configure outgoing mail?

Use an authenticated SMTP relay on port 587. Do not plan around direct delivery on port 25: whether it is open is not promised, so ask support with a ticket first if you need it. The relay route works regardless.

SMTP_HOST=smtp.example.net
SMTP_PORT=587
SMTP_USERNAME=infisical@example.net
SMTP_PASSWORD=relay-password
SMTP_FROM_ADDRESS=infisical@example.net
SMTP_FROM_NAME=Infisical

The SMTP relay guide explains how to choose a relay and set SPF and DKIM for the sender domain so invitations land in inboxes.

How do you start Infisical and keep it off the public interface?

Change the published port to loopback, then start the stack and check the status endpoint.

cd /opt/infisical
grep -n '8080' docker-compose.prod.yml
sudo sed -i 's/- "80:8080"/- "127.0.0.1:8080:8080"/' docker-compose.prod.yml
sudo docker compose -f docker-compose.prod.yml up -d
sudo docker compose -f docker-compose.prod.yml ps
curl -s http://127.0.0.1:8080/api/status; echo

The grep line shows how the port is written in your copy; adjust the sed pattern if it differs. The status call returns JSON once database migrations finish, which can take a minute on first start. Follow the logs with sudo docker compose -f docker-compose.prod.yml logs -f backend if it does not.

How do you add HTTPS in front of Infisical?

Point a reverse proxy at 127.0.0.1:8080. Caddy is the shortest route:

secrets.example.net {
    reverse_proxy 127.0.0.1:8080
}
sudo systemctl reload caddy
sudo ufw allow 80,443/tcp
curl -sI https://secrets.example.net | head -n 1

With Nginx, create a server block with proxy_pass http://127.0.0.1:8080;, proxy_set_header Host $host; and proxy_set_header X-Forwarded-Proto $scheme;, then run sudo certbot --nginx -d secrets.example.net. The Nginx reverse proxy guide has a full template.

How do you set up the first account and lock down signups?

Open https://secrets.example.net and register: the first account becomes the instance administrator. Then open the server admin console and turn off open signups, or restrict them to your company domain, so strangers cannot create accounts. Create an organisation, a project and its environments, and add a few test values. Enable two-factor authentication on the admin account in the personal settings before inviting anyone.

How do applications read their secrets?

Install the Infisical CLI on the machine that runs your app (the CLI docs list a package repository for Debian and Ubuntu), log in against your own domain and wrap the start command.

infisical --version
infisical login --domain https://secrets.example.net
cd ~/myapp
infisical init
infisical run --env=prod -- node server.js

infisical run injects the variables as environment variables for that process only, so no .env file sits on disk. For services without a human login, create a machine identity in the project with read access to one environment and use its credentials instead.

How do you back up and upgrade Infisical?

Dump PostgreSQL daily, keep the .env file safe and upgrade by changing the image tag.

cd /opt/infisical
sudo docker compose -f docker-compose.prod.yml exec -T db \
  pg_dump -U infisical infisical | gzip > /root/infisical-$(date +%F).sql.gz
sudo nano docker-compose.prod.yml       # set the new image tag
sudo docker compose -f docker-compose.prod.yml pull
sudo docker compose -f docker-compose.prod.yml up -d

Migrations run automatically when the new container starts. A dump without the matching ENCRYPTION_KEY cannot be decrypted, so back them up together but store them apart.

Plans that fit this guide

Base city prices. Every plan includes a dedicated IPv4 address, IPv6, full root and all 18 images.

All prices
PlanFits becauseSizeMonthlyOrder from
A2-2Infisical with bundled database for a small team2 vCPU, 2 GB RAM, 60 GB NVMe$10.80/mo$64.80 for 6 months
A2-4more projects and frequent CLI pulls2 vCPU, 4 GB RAM, 100 GB NVMe$14.40/mo$43.20 for 3 months

Questions about Infisical secrets manager

Is self-hosted Infisical free?

The core is open source under the MIT licence; some enterprise features need a licence key. Check the project site for the current split before you rely on a specific feature.

How much memory does Infisical use?

A small team fits in 2 GB with PostgreSQL and Redis on the same server. Give it 4 GB if many machines poll secrets often.

Can I use an external PostgreSQL server?

Yes. Point DB_CONNECTION_URI at it and remove the bundled database service from the Compose file. The PostgreSQL guide covers a native install.

Why do invitation emails not arrive?

Check the SMTP lines in .env, then the backend logs for the SMTP response. Use port 587 with authentication; ask support with a ticket before counting on direct delivery over port 25.

Can I keep the web UI private?

Yes. Restrict the proxy to your office or VPN addresses, for example by serving it only over a WireGuard tunnel, while CLI clients on the same network keep working.