Beginners Guide to Install Discourse on Ubuntu for Development

Use the command line (you’ll only be using the command line in production so you’d better get used to it! :slight_smile: )

I meant to say, the ~ directory. Not sure what that is.

[/edit] what the hell is production? :woozy_face:

~ means home directory for current user

‘production’ means the technical environment in which you ultimately run your public forum.

Open a terminal and doing as I have advised will take you to the discourse directory.

1 Like

During rubygems installation by this script, I was prompted whether to overwrite bundler (y/N, default No). Choosing No causes the script to exit and requires manual cleanup. Choosing y works fine.

As noted above, this appears to no longer be accurate.

bundle exec puma is working (listening on all interfaces) for me, and with that, I also had to run bundle exec sidekiq in a separate terminal window.

I would not use sidekiq in dev. The best way to start Discourse in dev is bin/unicorn it handles a whole bunch of things.

2 Likes

All well and good until I tried the step

sudo -u postgres createuser -s "$USER"

which gives result createuser: ‘could not connect to database postgres: could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket “/var/run/postgresql/.s.PGSQL.5432”?’

If you are using macos and homebrew, you can try this:

1 Like

Thanks Faizaan. Unfortunately I am running Ubuntu on a Windows 10 Subsystem for Linux

1 Like

You can try this

  1. stop the postgres server
  2. run the command rm /usr/local/var/postgres/postmaster.pid
  3. start the server again

This is my result

root@YETI:~# /usr/local/var/postgres/postmaster.pid
-bash: /usr/local/var/postgres/postmaster.pid: No such file or directory

2 Likes

you missed rm before that

Apologies - but still same result
root@YETI:~# rm /usr/local/var/postgres/postmaster.pid
rm: cannot remove ‘/usr/local/var/postgres/postmaster.pid’: No such file or directory

2 Likes

I have tried to install discourse, but it seems I cannot find it (the file). I am a very beginner in Linux command. Someone would like to help me, please?

1 Like

Hello @Paul_King, I got the same problem as you! Did you find a solution?

Hey Arthur. I think you should follow this guide for setting up Discourse dev env on Windows:

6 Likes

@techAPJ It helped me! Thank you :slightly_smiling_face:

3 Likes

Does this work on a VPS (DigitalOcean, Vultr)? I complete all the steps, including creating admin, but Discourse doesn’t load on port 3000 (I’ve tried other ports unsuccessfully).

What files do I need to change to work on my VPS?

No, this guide is intended for running Discourse in development mode on your local computer. To install Discourse on a production server, follow this guide: discourse/INSTALL.md at master · discourse/discourse · GitHub.

4 Likes

I’m working on a bbpress migration. Tutorials require development version.

You can run it from inside the production container. There are some other howto documents that may be good examples, but it’s a little tricky.

2 Likes