Skip to content

Instantly share code, notes, and snippets.

@samie
Last active November 6, 2023 16:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save samie/3d9e1d6274be5cbda7e25356a1efcad3 to your computer and use it in GitHub Desktop.
Save samie/3d9e1d6274be5cbda7e25356a1efcad3 to your computer and use it in GitHub Desktop.
Steps to install Discourse in a VM using Multipass
## Multipass on macOS
# Download and install: open https://multipass.run/download/macos
## Create Discourse VM and open shell
multipass launch --disk 8G --memory 4G --name discourse-server && multipass shell discourse-server
## Install NVM and Node 18 LTS
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash && source ~/.bashrc && nvm install v18.18.2
## Install yarn
npm -g install yarn
## Run the Discourse install script:
cd ~ && bash <(wget -qO- https://raw.githubusercontent.com/discourse/install-rails/master/linux)
## Clone the discourse repo
cd ~ && git clone https://github.com/discourse/discourse.git ~/discourse
## Install everything
cd ~/discourse && source ~/.bashrc && bundle install && yarn install
## DB migrate
cd ~/discourse && bin/rails db:create && bin/rails db:migrate && RAILS_ENV=test bin/rails db:create db:migrate
## Run!
cd ~/discourse && bin/ember-cli -u
@samie
Copy link
Author

samie commented Nov 2, 2023

Here is how to find the IP for the Discourse VM:

echo "http://$(multipass info discourse-server |grep IPv4 |awk -F':' '{print $NF}'| tr -d ' '):4200"

@marcushellberg
Copy link

You should perhaps not have the delete and purge command in the same script :)

@samie
Copy link
Author

samie commented Nov 6, 2023

Haha, true... I put that here instead:

## Delete and purge multipass instance when not needed anymore
multipass stop discourse-server &&  multipass delete discourse-server && multipass purge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment