Trying to install Discourse on Docker before server just testing software?

Hello,

I am trying to test the docker container for the discourse software because i was told it came bundled with postsql, and had all the databases configured and ready to go. bitnami:discourse:latest from docker … I am seeing this in my terminal



1. [Containers](app://dd/dashboard/containers)
2. /
3. tester

### tester


[bitnami/discourse:latest](app://dd/dashboard/images/local/details?imageId=sha256%3Aad71ab26c224ab1d50f4f57ec5ddbc7a549ff331f3cf442860307358d59f79d5&nameHint=bitnami%2Fdiscourse%3Alatest&nameHintType=image-identity)

440:3000

**STATUS**

Exited (1) (0 seconds ago)

LogsInspectBind mountsExecFilesStats

2025-05-16 15:43:26

discourse 19:43:26.78 INFO ==>

2025-05-16 15:43:26

discourse 19:43:26.79 INFO ==> Welcome to the Bitnami discourse container

2025-05-16 15:43:26

discourse 19:43:26.79 INFO ==> Subscribe to project updates by watching [https://github.com/bitnami/containers⁠](https://github.com/bitnami/containers)

2025-05-16 15:43:26

discourse 19:43:26.79 INFO ==> Did you know there are enterprise versions of the Bitnami catalog? For enhanced secure software supply chain features, unlimited pulls from Docker, LTS support, or application customization, see Bitnami Premium or Tanzu Application Catalog. See [https://www.arrow.com/globalecs/na/vendors/bitnami/⁠](https://www.arrow.com/globalecs/na/vendors/bitnami/) for more information.

2025-05-16 15:43:26

discourse 19:43:26.79 INFO ==>

2025-05-16 15:43:26

discourse 19:43:26.80 INFO ==> Validating settings in POSTGRESQL_CLIENT_* env vars

2025-05-16 15:43:26

discourse 19:43:26.85 WARN ==> Hostname postgresql could not be resolved, this could lead to connection issues

2025-05-16 15:43:26

discourse 19:43:26.86 WARN ==> Hostname redis could not be resolved, this could lead to connection issues

2025-05-16 15:43:26

discourse 19:43:26.86 WARN ==> The DISCOURSE_DATABASE_PASSWORD environment variable is empty or not set. Set the environment variable ALLOW_EMPTY_PASSWORD=yes to allow a blank password. This is only recommended for development environments.

2025-05-16 15:43:26

discourse 19:43:26.86 WARN ==> The DISCOURSE_REDIS_PASSWORD environment variable is empty or not set. Set the environment variable ALLOW_EMPTY_PASSWORD=yes to allow a blank password. This is only recommended for development environments.

2025-05-16 15:43:26

discourse 19:43:26.86 INFO ==> Creating Discourse configuration file

2025-05-16 15:43:26

discourse 19:43:26.90 INFO ==> Ensuring Discourse directories exist

2025-05-16 15:43:26

discourse 19:43:26.91 INFO ==> Trying to connect to the database server

2025-05-16 15:44:27

discourse 19:44:27.12 ERROR ==> Could not connect to the database

Anyone know what to do as i thought the databases are configured on the first run? Anyone have basically a gitbook or a guide that can be used to figure this out, i know its third party and should be installed on a machine directly, so would this work from a docker continaer of just an empty OS such as Debian?

I really want to just see the software backend to be completely honest and than will remove the container, so looking for something that can be spun up quickly.

what is the best way using docker?

Running it through my terminal i am stuck at this screen and cannot find any discourse scripts, actually the whole folder is empty? under bin


alex@PollockFarm Scripts % docker run -ti --rm bitnami/discourse /bin/bash

discourse 19:43:37.88 INFO ==>

discourse 19:43:37.88 INFO ==> **Welcome to the Bitnami discourse container**

discourse 19:43:37.88 INFO ==> Subscribe to project updates by watching **https://github.com/bitnami/containers**

discourse 19:43:37.89 INFO ==> Did you know there are enterprise versions of the Bitnami catalog? For enhanced secure software supply chain features, unlimited pulls from Docker, LTS support, or application customization, see Bitnami Premium or Tanzu Application Catalog. See https://www.arrow.com/globalecs/na/vendors/bitnami/ for more information.

discourse 19:43:37.89 INFO ==>

Thanks

Alex

We don’t support Bitnami here, use their forums.

If you would like support here, use the standard install.

2 Likes

Ah darn thank you for your quick reply @merefield , could you suggest the direct link to their forum or what they use to communicate these problems?

Sooooooo

the best way is just to run this on barebones? Can you use docker and a basic debian build and just install all required packages? Just using it for testing want it to be removable quickly.

1 Like

I provided a link in my post :slight_smile:

1 Like

love how fast this works! Really getting into Discourse.

Thanks again! @merefield.

Edit found step by step instructions for the docker image:

https://hub.docker.com/r/bitnami/discourse

The recommended way to get the Bitnami Discourse Docker Image is to pull the prebuilt image from the Docker Hub Registry.

docker pull bitnami/discourse:latest

To use a specific version, you can pull a versioned tag. You can view the list of available versions in the Docker Hub Registry.

docker pull bitnami/discourse:[TAG]

If you wish, you can also build the image yourself by cloning the repository, changing to the directory containing the Dockerfile and executing the docker build command. Remember to replace the APP, VERSION and OPERATING-SYSTEM path placeholders in the example command below with the correct values.

git clone https://github.com/bitnami/containers.git
cd bitnami/APP/VERSION/OPERATING-SYSTEM
docker build -t bitnami/APP:latest .

How to use this image

Discourse requires access to a PostgreSQL database to store information. We’ll use the Bitnami Docker Image for PostgreSQL⁠ for the database requirements.

Using the Docker Command Line

Step 1: Create a network

docker network create discourse-network

Step 2: Create a volume for PostgreSQL persistence and create a PostgreSQL container

$ docker volume create --name postgresql_data
docker run -d --name postgresql \
  --env ALLOW_EMPTY_PASSWORD=yes \
  --env POSTGRESQL_USERNAME=bn_discourse \
  --env POSTGRESQL_PASSWORD=bitnami123 \
  --env POSTGRESQL_DATABASE=bitnami_discourse \
  --network discourse-network \
  --volume postgresql_data:/bitnami/postgresql \
  bitnami/postgresql:latest

Step 3: Create a volume for Redis persistence and create a Redis container

$ docker volume create --name redis_data
docker run -d --name redis \
  --env ALLOW_EMPTY_PASSWORD=yes \
  --network discourse-network \
  --volume redis_data:/bitnami/redis \
  bitnami/redis:latest

Step 4: Create volumes for Discourse persistence and launch the container

$ docker volume create --name discourse_data
docker run -d --name discourse \
  -p 8080:8080 -p 8443:8443 \
  --env ALLOW_EMPTY_PASSWORD=yes \
  --env DISCOURSE_DATABASE_USER=bn_discourse \
  --env DISCOURSE_DATABASE_PASSWORD=bitnami123 \
  --env DISCOURSE_DATABASE_NAME=bitnami_discourse \
  --env DISCOURSE_HOST=www.example.com \
  --network discourse-network \
  --volume discourse_data:/bitnami/discourse \
  bitnami/discourse:latest

Step 5: Launch the Sidekiq container

docker run -d --name sidekiq \
  --network discourse-network \
  --volume discourse_data:/bitnami/discourse \
  bitnami/discourse:latest /opt/bitnami/scripts/discourse-sidekiq/run.sh

Access your application at http://your-ip/

Run the application using Docker Compose
curl -sSL https://raw.githubusercontent.com/bitnami/containers/main/bitnami/discourse/docker-compose.yml > docker-compose.yml
docker-compose up -d

Please be aware this file has not undergone internal testing. Consequently, we advise its use exclusively for development or testing purposes. For production-ready deployments, we highly recommend utilizing its associated Bitnami Helm chart⁠.

If you detect any issue in the docker-compose.yaml file, feel free to report it or contribute with a fix by following our Contributing Guidelines⁠.

Troubleshooting discourse

If you need to run discourse administrative commands like Create admin account from console⁠, you can do so by executing a shell inside the container and running with the proper environment variables.

cd /opt/bitnami/discourse
RAILS_ENV=production bundle exec rake admin:create
2 Likes

You welcome @alex.diker and welcome to Meta :slight_smile:

1 Like

The recommended way is to follow the install instructions and remove the templates for postgres and redis and add the database settings in env variables.

The two container setup (which you can get by adding a switch to discourse-setup) is an easy way to figure out how to get the env variables.

The advantage over Bitnami is that you can get help here and install plugins following the standard instructions.