# Discourse in a Docker container

**URL:** https://meta.discourse.org/t/discourse-in-a-docker-container/10844
**Category:** Self-hosting
**Tags:** hosting
**Created:** [November 8, 2013, 12:12am UTC](https://meta.discourse.org/t/discourse-in-a-docker-container/10844 "2013-11-08T00:12:22Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [November 8, 2013, 12:12am UTC](https://meta.discourse.org/t/discourse-in-a-docker-container/10844/1 "2013-11-08T00:12:22Z")

</div>

FYI I just posted a blog post about my Docker adventures:

[http://samsaffron.com/archive/2013/11/07/discourse-in-a-docker-container](http://samsaffron.com/archive/2013/11/07/discourse-in-a-docker-container)

---

<div class="post-metadata">

### Author: ![erlend\_sh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/erlend_sh/32/119475_2.png) [@erlend\_sh](https://meta.discourse.org/u/erlend_sh)
#### Post date: [November 8, 2013, 11:21am UTC](https://meta.discourse.org/t/discourse-in-a-docker-container/10844/2 "2013-11-08T11:21:43Z")

</div>

I wonder how it compares against [Rubber](http://meta.discourse.org/t/simple-discourse-deployment-with-rubber/10029). Any huge differences? Did @supermathie test that one as well?

Anyhow, wonderful news! Really looking forward to install Discourse all by my lonesome, no friends required.

---

<div class="post-metadata">

### Author: ![erlend\_sh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/erlend_sh/32/119475_2.png) [@erlend\_sh](https://meta.discourse.org/u/erlend_sh)
#### Post date: [January 8, 2014, 10:48pm UTC](https://meta.discourse.org/t/discourse-in-a-docker-container/10844/3 "2014-01-08T22:48:07Z")

</div>

It seems you’re frequently recommending people to use the Docker installer as opposed to following the default Ubuntu Install Guide now. Time for Docker to ascend the throne as Default Install Guide perhaps?

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [January 8, 2014, 10:50pm UTC](https://meta.discourse.org/t/discourse-in-a-docker-container/10844/4 "2014-01-08T22:50:09Z")

</div>

Possibly, we have been running it in production and on multiple sites now for over a month.

I only enjoy supporting docker stuff, otherwise there are just too many variables.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [January 8, 2014, 11:09pm UTC](https://meta.discourse.org/t/discourse-in-a-docker-container/10844/5 "2014-01-08T23:09:22Z")

</div>

A few notable things missing before that can happen

- Sam’s guide on how to upgrade non-Docker instances to Docker here on meta

- Blog post on [blog.discourse.org](http://blog.discourse.org) blessing Docker as our preferred setup method, explaining why, answering top 5 FAQs about it, and pointing to a newly edited install doc on github that reflects this

---

<div class="post-metadata">

### Author: ![meglio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/meglio/32/71444_2.png) [@meglio](https://meta.discourse.org/u/meglio)
#### Post date: [January 11, 2014, 1:03am UTC](https://meta.discourse.org/t/discourse-in-a-docker-container/10844/6 "2014-01-11T01:03:54Z")

</div>

What’s the current recommended way to use Docker for Discourse?

1. Readme from [GitHub - discourse/discourse\_docker: A Docker image for Discourse · GitHub](https://github.com/SamSaffron/discourse_docker) (and using git clone)
2. _This is how you would work through it_ section from Sam’s blog entry [http://samsaffron.com/archive/2013/11/07/discourse-in-a-docker-container](http://samsaffron.com/archive/2013/11/07/discourse-in-a-docker-container)
3. docker pull samsaffron/discourse

---

<div class="post-metadata">

### Author: ![meglio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/meglio/32/71444_2.png) [@meglio](https://meta.discourse.org/u/meglio)
#### Post date: [January 11, 2014, 1:56am UTC](https://meta.discourse.org/t/discourse-in-a-docker-container/10844/7 "2014-01-11T01:56:45Z")

</div>

Just as a note, I’ve tried **Docker** #1 (i.e. **Sam’s GitHub readme file** ) on top of a **fresh $5 DigitalOcean VPS** (the smallest one). Watching htop: ~80% of the time my CPU is 100% busy with sidekiq, memory usage 450MB out of 490MB. Is this because of Docker or just because of the nature of the environment Discourse is built on? (i.e. ruby, so there is just some minimal requirement that should be _always_ met no matter whether any kind of virtualization is used or not).

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [January 11, 2014, 3:11am UTC](https://meta.discourse.org/t/discourse-in-a-docker-container/10844/8 "2014-01-11T03:11:48Z")

</div>

That would be a regression we had this week, bootstrap again with latest

The instructions on guthub are the most up to date

I would avoid any vps with less than a gb of ram

How was the install process?

---

<div class="post-metadata">

### Author: ![meglio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/meglio/32/71444_2.png) [@meglio](https://meta.discourse.org/u/meglio)
#### Post date: [January 11, 2014, 12:37pm UTC](https://meta.discourse.org/t/discourse-in-a-docker-container/10844/9 "2014-01-11T12:37:01Z")

</div>

> [@sam](#):
>
> That would be a regression we had this week, bootstrap again with latest

Sorry, I’m confused - what do you mean?

> [@sam](#):
>
> How was the install process?

It was easy enough and with no errors. Probably more questions might come later when I try to use it - thanks.

---

<div class="post-metadata">

### Author: ![trident](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/trident/32/2078_2.png) [@trident](https://meta.discourse.org/u/trident)
#### Post date: [January 11, 2014, 12:40pm UTC](https://meta.discourse.org/t/discourse-in-a-docker-container/10844/10 "2014-01-11T12:40:01Z")

</div>

> [@meglio](#):
>
> Sorry, I’m confused - what do you mean?

I believe that has to do with this regression:  
[https://meta.discourse.org/t/sidekiq-cpu-load-since-latest-release/9515/22](https://meta.discourse.org/t/sidekiq-cpu-load-since-latest-release/9515/22)

---

<div class="post-metadata">

### Author: ![meglio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/meglio/32/71444_2.png) [@meglio](https://meta.discourse.org/u/meglio)
#### Post date: [January 11, 2014, 1:59pm UTC](https://meta.discourse.org/t/discourse-in-a-docker-container/10844/11 "2014-01-11T13:59:30Z")

</div>

So if I understand correctly I just have to update my Discourse. But how would I do it with a Docker installation from cli? Please advice.

After first bootstrap & run, I couldn’t access via ssh, so I’ve generated an ssh key in the host machine under root and added it to containers/app.yml:

> ssh\_key: ssh-rsa AAAAB3NzaC1…

I’ve tried ./launcher stop, bootstrap, start and when I ./launcher ssh app, it still asks for a password:

> [root@0.0.0.0](mailto:root@0.0.0.0)’s password:

So I cannot SSH - please advice.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [January 11, 2014, 7:43pm UTC](https://meta.discourse.org/t/discourse-in-a-docker-container/10844/12 "2014-01-11T19:43:53Z")

</div>

You must destroy the old container to upgrade, see the upgrading discourse instructions in the readme

---

<div class="post-metadata">

### Author: ![sedrickcz](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sedrickcz/32/107916_2.png) [@sedrickcz](https://meta.discourse.org/u/sedrickcz)
#### Post date: [January 21, 2014, 4:36pm UTC](https://meta.discourse.org/t/discourse-in-a-docker-container/10844/13 "2014-01-21T16:36:59Z")

</div>

Hi.  
I installed docker discourse on my ubuntu 12.04 and I want access my container via ssh.  
I did everything what is written here: [GitHub - discourse/discourse\_docker: A Docker image for Discourse · GitHub](https://github.com/discourse/discourse_docker#troubleshooting)  
and if I bootstrap my app I have this error:

```
"echo ssh-rsa fsfdsfdsfd ....... root's key >> /root/.ssh/authorized_keys sh: 1: Syntax error: Unterminated quoted string"

```

What should I do? I tried quote my ssh key in containers/app.yml and still error.

Thank you.

---

<div class="post-metadata">

### Author: ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)
#### Post date: [January 21, 2014, 5:52pm UTC](https://meta.discourse.org/t/discourse-in-a-docker-container/10844/14 "2014-01-21T17:52:18Z")

</div>

> [@sedrickcz](#):
>
> root’s key

Pretty sure that’s where the unterminated quote is coming from. I think you were supposed to _replace_ `root's key`, not leave it in.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [January 21, 2014, 10:37pm UTC](https://meta.discourse.org/t/discourse-in-a-docker-container/10844/15 "2014-01-21T22:37:02Z")

</div>

Yeah, where is this `root's key` coming from? why was it added?

---

<div class="post-metadata">

### Author: ![sedrickcz](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sedrickcz/32/107916_2.png) [@sedrickcz](https://meta.discourse.org/u/sedrickcz)
#### Post date: [January 22, 2014, 8:37am UTC](https://meta.discourse.org/t/discourse-in-a-docker-container/10844/16 "2014-01-22T08:37:11Z")

</div>

Ohh, right 🙂 I copied whole key from id\_rsa.pub with it’s description .)

---

<div class="post-metadata">

### Author: ![sedrickcz](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sedrickcz/32/107916_2.png) [@sedrickcz](https://meta.discourse.org/u/sedrickcz)
#### Post date: [January 31, 2014, 1:17am UTC](https://meta.discourse.org/t/discourse-in-a-docker-container/10844/17 "2014-01-31T01:17:31Z")

</div>

Hi I made some changes inside docker container. Add additional text field for user and some little stuffs. And I committed and I want to display the changes in production. But nothing happens. I tried to restart docker, but nothing. Any help? Thank you.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [January 31, 2014, 1:34am UTC](https://meta.discourse.org/t/discourse-in-a-docker-container/10844/18 "2014-01-31T01:34:00Z")

</div>

All changes need to come from the outside, I strongly recommend against changing stuff inside containers, next time you bootstrap they will be gone.

FYI to restart stuff inside a container use `sv`

```plaintext
sv stop unicorn
sv start unicorn 
sv stop sidekiq 
sv start sidekiq

```

---

<div class="post-metadata">

### Author: ![sedrickcz](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sedrickcz/32/107916_2.png) [@sedrickcz](https://meta.discourse.org/u/sedrickcz)
#### Post date: [January 31, 2014, 1:40am UTC](https://meta.discourse.org/t/discourse-in-a-docker-container/10844/19 "2014-01-31T01:40:46Z")

</div>

Ok, thanks.

And what is your recommendation how can I add a new column to db and updates handlebars? I have to fork it or is there any easy way? Thank you.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [January 31, 2014, 1:44am UTC](https://meta.discourse.org/t/discourse-in-a-docker-container/10844/20 "2014-01-31T01:44:31Z")

</div>

Ideally, you create a plugin and source that plugin during bootstrap (same as we do for the discourse\_docker plugin in the template)

Otherwise, fork is your only correct option

[Next page](https://meta.discourse.org/t/discourse-in-a-docker-container/10844.md?page=2)
