How to update to Discourse 1.0?

(Sam Saffron) #1

Now that Discourse 1.0 is released, you’re wondering how to update your existing Discourse installation to the first non-beta release.

Move discourse docker from /var/docker to /var/discourse

Our official location for docker install has moved, we recommend you keep your install in /var/discourse as opposed to /var/docker

cd /var/docker
./launcher stop app
# Change all references to /var/docker to /var/discourse (volumes:...)
nano containers/app.yml
cd /
mv /var/docker /var/discourse

To search and replace all instances in nano, use Ctrl+\.

Update Docker

The latest version of Docker contains many urgent fixes, most notably, restart policies ensure your Discourse image will come back to life after a reboot.

apt-get update
apt-get dist-upgrade lxc-docker

Ensure you are tracking the desired Discourse branch

Discourse has 3 official branches:

  1. tests-passed: updated most frequently after our test suite runs. This is the branch we deploy most of our customers on.
  2. beta: updated weekly(ish), a snapshot of tests-passed.
  3. stable: where our major releases live (with security fixes backported as they arise)

Pick your desired branch. This find by editing the file nano containers/app.yml

   version: tests-passed # or beta or stable

Update to the latest Docker image

Our newest Docker image resolves quite a few issues (log rotation, syslog works correctly, permissions, security), we strongly recommend you upgrade.

cd /var/discourse
git pull
./launcher rebuild app

Customize subject format for standard emails
Which branch of Discourse is used internally?
Renaming Discourse's root directory?
(Jeff Atwood) #2

(Michael Downey) #3

The instructions don’t say where to adjust params. :slight_smile:

(Michael Downey) #4

FYI, when I did ./launcher rebuild app I got about 20 or so blank lines over several minutes after

Pulling repository samsaffron/discourse

At which point I did a Ctrl+C and tried it again, at which point I got normal output.

(Jeff Atwood) #5

That is actually “normal”, though I don’t know why.

(Sam Saffron) #6

I will see if there is some way to get this to produce a sane output. It’s somewhat related to docker pull without crazytown control code central · Issue #3694 · moby/moby · GitHub but different

(Scott Shillcock) #7

I was wondering the same thing. So I went poking around and found it in app.yml.

cd /var/discourse
vi containers/app.yml

Starting at line 21, I see the following:

  ## Which Git revision should this container use? (default: tests-passed)
  #version: tests-passed

Since I want tests-passed the default works for me so I didn’t make any edits.

Update: Go here for a more detailed answer:

(@SenpaiMass) #8

hello any specific reason for moving /var/docker/ to /var/discourse/ ?

(Sam Saffron) #9

Branding, this is a discourse specific setup. /var/docker really should be reserved for general docker stuff.

(Zander) #10

I am getting this why i try the update:

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

/usr/local/bin/ruby extconf.rb 

Cannot allocate memory - /usr/local/bin/ruby extconf.rb 2>&1

Gem files will remain installed in /var/www/discourse/vendor/bundle/ruby/2.0.0/gems/nokogiri- for inspection.
Results logged to /var/www/discourse/vendor/bundle/ruby/2.0.0/extensions/x86_64-linux/2.0.0-static/nokogiri-
An error occurred while installing nokogiri (, and Bundler cannot
Make sure that gem install nokogiri -v '' succeeds before bundling.

I am not familiar with debugging gem issues. Any help would be greatly appreciated.

(Sam Saffron) #11

Are you using our docker based setup?

(Jeff Atwood) #12

Out of memory. The update process puts unusual pressure on memory.

Run free -m. Add a small swapfile, as documented here.

(Zander) #13

@sam @codinghorror Yea I am using the “cheapo” option at the moment from Digital Ocean and the swapfile resolved the issue. Thanks.

(Jens Maier) #14

Upgrading my unsupported and dockerless Discourse instance more or less went like this:

discourse@majestix ~ $ scripts/upgrade
discourse@majestix ~ $ exit


(Daniel Hollands) #15

Would you recommend that people stay on tests-passed, or do you think stable is the better one to be on? What could I be missing out on by not using tests-passed?

(Alles ist erlaubt) #17

Debian users: Be advised this update will not work with the docker package available through official repos. After a git pull in /var/discourse, launcher will tell you docker 1.0.0 is no longer supported. You can use the script at to get a newer version. It will replace package with lxc-docker 1.2.0 (and add apt source etc.).

(Sam Saffron) #18

Yes, I just changed this, we have seen issues with earlier versions of Docker so I am using v1 to ensure everyone are synched on Docker 1.2.0

Docker is still moving fast and there are critical issues in various releases post 1.0 than needed addressing.

(Kane York) #19

If you’re worried about “missing out” on things, you’re probably one of the people who can run on tests-passed.

The whole point of beta and stable is to have more, well, stabliity.

(Daniel Hollands) #20

I’m thinking I’d probably rather track the stable branch then - don’t want to risk the community on something which might not be 100% (such as the bug last week which prevented people from posting messages)

(Jeff Atwood) #21

Yeah, but how long was that bug even present in tests-passed? An hour? So you can always update again, too.