Discourse on a Raspberry Pi | Blog

A long standing feature request from our community is finally here! As of today, you are able to host a complete Discourse instance in a $35 Raspberry Pi. You can go ahead and follow our official install guide, and it will work out of the box in any recent Raspberry Pi model.


This is a companion discussion topic for the original entry at https://blog.discourse.org/2021/12/2021-12-07-discourse-on-a-raspberry-pi/
53 Likes

Yet again, Discourse having a really great influence on the industry!

16 Likes

This is awesome.

I think it’s worth mentioning that Oracle Cloud is offering as “Always Free” 4 ARM-based Ampere A1 cores and 24GB of RAM that can be used in up to 4 VMs.

17 Likes

This is a great excuse for me to get another Raspberry Pi :tada:

18 Likes

Amazing! :heart_eyes:

I have always wanted to spin up a local network for my neighborhood with a mirror of our forum on it, to use for emergency communication when the power goes out. Would be fun to try to get this going now!

12 Likes

This is great.
I mentioned it to Jeff Geerling.
Maybe we will get a YouTube video of making a Discourse site on a Raspberry Pi cluster.

9 Likes

Do you think a regular Joe Blow could install Discourse by following the directions carefully, or would one need to be a developer to even understand the lingo?

3 Likes

This is great!

What about the performance difference between using RPi4 with SD card or SSD? Is the SD card enough?

I found this: Discourse on a residential internet with Cloudflare Tunnel

Last question: Are you using 64bit or 32bit OS with RPI4? Ubuntu Server 20.04.3 LTS 64bit for Raspberry Pi 4?

4 Likes

While the DB is small there should be no difference. If your database is larger than the Pi RAM it may be a clue to change to something a little more robust :sweat_smile:

Raspbian arm64 version from Index of /raspios_lite_arm64/images/raspios_lite_arm64-2021-11-08

4 Likes

Unfortunately, failed…

FAILED
--------------------
Pups::ExecError: cd /var/www/discourse && [ ! -d 'node_modules' ] || su discourse -c 'yarn install --production && yarn cache clean' failed with return #<Process::Status: pid 3539 exit 1>
Location of failure: /pups/lib/pups/exec_command.rb:112:in `spawn'
exec failed with the params {"cd"=>"$home", "cmd"=>["[ ! -d 'node_modules' ] || su discourse -c 'yarn install --production && yarn cache clean'"]}
53e9103763b3963785452f314d9c0023f280ebe76d33a1271a6439d23e8c8ad9
** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one.
./discourse-doctor may help diagnose the problem.
1 Like

Can you

please scroll up and look for earlier error messages, there may be more than one.

?

1 Like
I, [2022-01-24T00:30:34.893970 #1]  INFO -- : > cd /var/www/discourse && [ ! -d 'node_modules' ] || su discourse -c 'yarn install --production && yarn cache clean'
warning Resolution field "lodash@4.17.21" is incompatible with requested version "lodash@4.17.15"
2022-01-24 00:31:15.883 UTC [59] LOG:  using stale statistics instead of current ones because stats collector is not responding
2022-01-24 00:31:26.025 UTC [3596] LOG:  using stale statistics instead of current ones because stats collector is not responding
2022-01-24 00:31:55.876 UTC [59] LOG:  using stale statistics instead of current ones because stats collector is not responding
2022-01-24 00:32:06.068 UTC [3606] LOG:  using stale statistics instead of current ones because stats collector is not responding
2022-01-24 00:32:15.830 UTC [59] LOG:  using stale statistics instead of current ones because stats collector is not responding
2022-01-24 00:32:26.023 UTC [3617] LOG:  using stale statistics instead of current ones because stats collector is not responding
2022-01-24 00:32:40.294 UTC [3621] LOG:  using stale statistics instead of current ones because stats collector is not responding
2022-01-24 00:32:55.848 UTC [59] LOG:  using stale statistics instead of current ones because stats collector is not responding
2022-01-24 00:33:06.000 UTC [3627] LOG:  using stale statistics instead of current ones because stats collector is not responding
2022-01-24 00:33:20.766 UTC [3628] LOG:  using stale statistics instead of current ones because stats collector is not responding
2022-01-24 00:33:55.862 UTC [59] LOG:  using stale statistics instead of current ones because stats collector is not responding
2022-01-24 00:34:06.039 UTC [3634] LOG:  using stale statistics instead of current ones because stats collector is not responding
2022-01-24 00:34:22.558 UTC [3635] LOG:  using stale statistics instead of current ones because stats collector is not responding
2022-01-24 00:34:35.852 UTC [59] LOG:  using stale statistics instead of current ones because stats collector is not responding
2022-01-24 00:34:46.031 UTC [3637] LOG:  using stale statistics instead of current ones because stats collector is not responding
2022-01-24 00:34:55.859 UTC [59] LOG:  using stale statistics instead of current ones because stats collector is not responding
2022-01-24 00:35:06.036 UTC [3638] LOG:  using stale statistics instead of current ones because stats collector is not responding
error An unexpected error occurred: "https://registry.yarnpkg.com/rxjs/-/rxjs-6.6.3.tgz: ESOCKETTIMEDOUT".
I, [2022-01-24T00:35:14.127245 #1]  INFO -- : yarn install v1.22.17
[1/5] Validating package.json...
[2/5] Resolving packages...
[3/5] Fetching packages...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
info If you think this is a bug, please open a bug report with the information provided in "/var/www/discourse/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

I, [2022-01-24T00:35:14.128342 #1]  INFO -- : Terminating async processes
I, [2022-01-24T00:35:14.128463 #1]  INFO -- : Sending INT to HOME=/var/lib/postgresql USER=postgres exec chpst -u postgres:postgres:ssl-cert -U postgres:postgres:ssl-cert /usr/lib/postgresql/13/bin/postmaster -D /etc/postgresql/13/main pid: 52
I, [2022-01-24T00:35:14.128549 #1]  INFO -- : Sending TERM to exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf pid: 113
2022-01-24 00:35:14.128 UTC [52] LOG:  received fast shutdown request
113:signal-handler (1642984514) Received SIGTERM scheduling shutdown...
113:M 24 Jan 2022 00:35:14.221 # User requested shutdown...
113:M 24 Jan 2022 00:35:14.221 * Saving the final RDB snapshot before exiting.
I, [2022-01-24T00:35:24.131678 #1]  INFO -- : HOME=/var/lib/postgresql USER=postgres exec chpst -u postgres:postgres:ssl-cert -U postgres:postgres:ssl-cert /usr/lib/postgresql/13/bin/postmaster -D /etc/postgresql/13/main pid:52 did not terminate cleanly, forcing termination!
I, [2022-01-24T00:35:24.132139 #1]  INFO -- : exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf pid:113 did not terminate cleanly, forcing termination!
1 Like

An there it is:

Your connection is too flaky to build Discourse. I just rebuilt on my wired Pi4 without a problem, so you may want to check your networking.

4 Likes

Your website is offline.


Also if it’s accurate happy birthday :tada:

5 Likes

Oh thanks for the reminder. It got lost when I moved houses a few months ago. Turned it on again just now and updated it to latest.

Thanks!

6 Likes

hi @Falco, thank you for sharing such a wonderful piece of information.
I got my first own forum running!!! Thanks to you!!!
Is it possible for me to access the forum with the machine local ip address? When my discourse hostname is already set to a domain (got it from freenom).
When i tried to access the forum with the machine’s ip address, the page always stuck at loading and never managed to load.
I got a use case where my client machine is connected to some VPN and have no access to internet. The only way for me to access the forum is through the local network ip address.

2 Likes

You might find this discussion useful. You are asking for support on a very non-standard install:

2 Likes

Thanks @merefield.
I find when using curl on the server’s local ip address it returns the page but not with a browser.
It’s got to do with the settings on the browser?

You need to access the app via domain name for several reasons. IP access is not supported afaik

1 Like

Got it! Thanks on the confirmation.

1 Like