How to Self-Host Nginx Ignition Locally Using Docker Compose and PostgreSQL

How to Self-Host Nginx Ignition Locally Using Docker Compose and PostgreSQL
A Step-by-Step Guide to Running Nginx Ignition Locally with Docker and PostgreSQL

What is Nginx Ignition?

Nginx Ignition is an user interface for the nginx web server, aimed at developers and enthusiasts that don't want to manage configuration files manually

Today, I’ll walk you through the steps to self-host Nginx Ignition on your local machine using Docker Compose and connect to a PostgreSQL database.


🧰 Prerequisites

Make sure you have the following installed on your local machine:
- Docker
- Docker Compose
💡 Tip: You can verify the installations by running docker --version and docker compose version in your terminal.


📁 Directory Structure

Create a directory like this for your setup:

nginx-ignition-docker/
├── .env
└── docker-compose.yml

(You can name it anything you'd like, but for this example, I’ll use nginx-ignition-docker. )


⚙️ Step 1: Create the docker-compose.yml File

services:
  nginx-ignition:
    container_name: nginx-ignition
    image: dillmann/nginx-ignition:latest
    restart: unless-stopped
    environment:
      NGINX_IGNITION_DATABASE_DRIVER: postgres
      NGINX_IGNITION_DATABASE_HOST: ${POSTGRESDB_HOST}
      NGINX_IGNITION_DATABASE_PORT: ${POSTGRESDB_PORT}
      NGINX_IGNITION_DATABASE_NAME: ${POSTGRES_DB}
      NGINX_IGNITION_DATABASE_SSL_MODE: disable
      NGINX_IGNITION_DATABASE_USERNAME: ${POSTGRES_USER}
      NGINX_IGNITION_DATABASE_PASSWORD: ${POSTGRES_PASSWORD}
    ports:
      - "80:80"      # Web UI
      - "8090:8090"  # Nginx Ignition Default Port

⚙️ Step 2: Create an .env file in the same directory of docker-compose.yml:

POSTGRESDB_HOST=<database_ip>           # IP address of the PostgreSQL server
POSTGRESDB_PORT=<database_port>         # Port number for PostgreSQL
POSTGRES_DB=<database_name>             # Name of the PostgreSQL database
POSTGRES_USER=<username>                # PostgreSQL Username
POSTGRES_PASSWORD=<password>            # PostgreSQL Password

🚀 Step 3: Launch the Containers:

docker-compose up -d

Access to Nginx-ignition from the browser via http://localhost:8090:

If you found this guide helpful, consider supporting me!

Read more