How do I install a stable version of Discourse on Docker locally?

Hello everyone,

I was able to install Discourse on docker locally by following these instructions: Beginners Guide to Install Discourse for Development using Docker

The only issue I have is that I need to be able to test run a stable version of Discourse (2.6) so that I can run some tests. What’s currently installed is: 2.7.0.beta9

Throughout the installation process above, what is it that I need to change so that I install the stable version of Discourse?

Thank you!

You should be able to cd into the source directory and use git to checkout the version you want. You’ll need to drop, create, and migrate the database.

Hi @pfaffman thanks for that, I was able to get the tag for 2.6.6.

I am running into this error:

WARNING: It looks like your discourse plugins or core version have recently changed.
The tmp/cache directory will be wiped to avoid development issues.

Traceback (most recent call last):
1: from bin/unicorn:63:in `<main>'
bin/unicorn:31:in `ensure_cache_clean!': uninitialized constant FileUtils (NameError)
Did you mean?  FileTest

How do I ensure the cache clean so I can proceed?


When I tried to re-init it, this is what I got:

Migrating database...
rake aborted!
NoMethodError: undefined method `[]' for nil:NilClass
/src/lib/migration/safe_migrate.rb:56:in `migrate'
/src/lib/tasks/db.rake:215:in `block in <main>'
/usr/local/bin/bundle:23:in `load'
/usr/local/bin/bundle:23:in `<main>'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)


rm -r tmp

Did you drop and create the database before trying to migrate it?

Sorry @pfaffman, I’m quite new to this so my questions might be quite basic. I didn’t have any essential information on the current database so I didn’t think I needed to migrate it, after I

git checkout v2.6.6

I attempted to re-initalize it, so I got the errors above. How do I go about dropping and creating the database? I attempted the Notes from the guide: Beginners Guide to Install Discourse for Development using Docker but none of them worked for me

Sorry. Yes, there’s a lot to learn.

./bin/rake db:drop db:create db:migrate

What are you trying to test? Do you really need a development environment?

1 Like

Thanks @pfaffman ,

I am trying to come up with a local environment within Docker to test and play with plugins as well as explore the API. Also was hoping everything would be in Docker so it can be easily shared with colleagues but it seems like ember-cli & yarn are run locally. Is there a fully packaged Docker container of Discourse at all that doesn’t use anything locally?

After attempting
./bin/rake db:drop db:create db:migrate
I ran into this error:

$ ./bin/rake db:drop db:create db:migrate
rake aborted!
PG::ConnectionBad: could not connect to server: No such file or directory
    Is the server running locally and accepting
    connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
Tasks: TOP => db:drop => db:load_config => environment

I was able to run everything on the beta version but since downgrading it seems like I’m having trouble with the database part