First create the Volume for the Postgres
docker volume create pgdata
Now Run the Container
docker run -d –name postgres -e POSTGRES_USER=myuser -e POSTGRES_PASSWORD=mypassword -e POSTGRES_DB=mydb -p 5432:5432 -v pgdata:/var/lib/postgresql/data postgres:16
You must check the postgress is up and running
- Use a client application like DBever
Next Install the N8N container
docker run -d –name n8n -p 5678:5678 -e GENERIC_TIMEZONE=”Pacific/Auckland” -e TZ=”Pacific/Auckland” -e N8N_SECURE_COOKIE=false -e N8N_RUNNERS_ENABLED=true -e DB_TYPE=postgresdb -e DB_POSTGRESDB_DATABASE=mydb -e N8N_HOST=192.168.56.101 -e DB_POSTGRESDB_HOST=192.168.56.101 -e DB_POSTGRESDB_PORT=5432 -e DB_POSTGRESDB_USER=sat -e DB_POSTGRESDB_PASSWORD=Pass@123 -v n8n_data:/home/node/.n8n docker.n8n.io/n8nio/n8n:1.68.0