
Infisical is an open-source, end-to-end encrypted secret management platform. It is often viewed as a more developer-friendly alternative to HashiCorp Vault, featuring a modern dashboard, SDKs for every major programming language, and native integrations with platforms such as Vercel, AWS, and GitHub.
This article demonstrates how to deploy a production-ready Infisical instance on Ubuntu 24.04 using Docker Compose. The stack includes PostgreSQL for data storage, Redis for caching, and Traefik for automatic HTTPS termination.
Before you begin:
infisical.example.com, to point to your server’s public IP address.Infisical requires persistent storage for its database, cache, and certificates, along with several environment variables that define how the service operates. This section creates the necessary directory structure and prepares the .env file, including the required encryption keys.
Create the project folders.
db - Persistent storage for PostgreSQL (users, encrypted secrets).redis - Persistent storage for the Redis queue.letsencrypt - Traefik ACME certificates.Navigate to the root Infisical directory.
Generate a random Encryption Key (128-bit, hex-encoded).
Copy the output and save it for the ENCRYPTION_KEY needed in the next section.
Generate a random Auth Secret (256-bit, base64-encoded).
Copy the output and save it for the AUTH_SECRET needed in the next section.
Create a file named .env in the project directory.
Add the following values. Paste the keys you generated in the previous step where indicated.
Replace:
infisical.example.com with your domain.admin@example.com with your email address.HEX_KEY_HERE with the hex key generated earlier.BASE64_SECRET_HERE with the base64 secret.STRONG_DB_PASSWORD with a secure password.Save and close the file.
This section defines the Docker Compose stack required to run Infisical. The deployment consists of three core components: Infisical itself, PostgreSQL, and Redis, along with Traefik for HTTPS termination. Each service is configured to run in its own container and communicate over a shared Docker network.
Add your user account to the docker user group.
Apply new group membership.
Create the Docker Compose manifest file.
Add the following contents:
Save and close the file. This Docker Compose configuration deploys Infisical, PostgreSQL, and Redis, with Traefik handling HTTPS routing and certificate management. Each service in the stack plays a specific role:
infisical service
infisical/infisical image..env file.db) and Redis (redis) services to store encrypted secrets and manage caching.${INFISICAL_DOMAIN}) to the Infisical container over port 8080.TELEMETRY_ENABLED=false is set.db service (PostgreSQL)
postgres:16-alpine image../db directory on the host..env file.redis service
redis:alpine image, acting as a caching layer and message broker for Infisical../redis folder.REDIS_URL=redis://redis:6379.traefik service
./letsencrypt directory.Start all services in detached mode.
Check the container status.
Wait a moment for infisical-db to initialize. The infisical container may restart once or twice during initial startup while waiting for PostgreSQL to complete initialization.
For more information on managing a Docker Compose stack, see the How To Use Docker Compose article.
Once the containers are running, you must set up your first administrator account.
Open your browser and visit your domain https://infisical.example.com. You should see a welcome page prompting you to create your first Super Admin Account.
Enter your First name, last name, email, and a strong password to create the initial administrative user. Click Continue to access your Infisical dashboard.
You have successfully deployed Infisical on Ubuntu 24.04. You now have a modern, end-to-end encrypted platform for managing secrets across your development teams and infrastructure. For more information, refer to the Infisical documentation.
0 Comments
Be the first to comment and share your perspective with the community.