Tuesday, April 30, 2024
7
rated 0 times [  7] [ 0]  / answers: 1 / hits: 2716  / 2 Years ago, thu, june 30, 2022, 11:37:30

I have a spare Ubuntu machine lying around and I would like to install Discourse on it.



How do I do this? I'm running Ubuntu 13.04.


More From » software-installation

 Answers
5

The instructions assume you need vagrant to install Ubuntu, and are apparently geared towards people mainly using Windows or Mac and who would benefit from a separate VM to install and play with discourse. If Seth has an "Ubuntu machine lying around" with 13.04 already installed, he can just clone the git repo and set it up locally.



Setting things up locally and manually is documented here on GitHub. However it does seem a bit complex, the vagrant VM has all the needed services (pgsql, redis) already preconfigured so may be easier to get started with.



That said, if you're feeling brave, you can follow these steps to install and configure things on your local Ubuntu machine.



Disclaimer, it is a complex procedure that involves many moving parts, I tested this procedure on a freshly installed 13.04 system but if things go wrong, you should be prepared to decypher error messages and fix things. You should be comfortable with:




  • Ubuntu package installation.

  • Text file editing.

  • Having some knowledge of Postgres commandline usage.

  • Being minimally familiar with Ruby, Rails and rubygems.

  • Some git doesn't hurt, but it's only used for the initial cloning phase



OK, here goes



Install needed packages:



sudo apt-get install git ruby ruby-bundler build-essential libxml2-dev libxslt1-dev redis-server postgresql libpq-dev postgresql-contrib-9.1


Create a postgresql database and grant permissions to the user who is going to run discourse (I'll assume it's named "john", it could/should be your username):



sudo -u postgres createdb discourse_development
sudo -u postgres psql -c "create user john with password 'whatever' "
sudo -u postgres psql -c "grant all privileges on database discourse_development to john"
#This is a bit of postgresql magic to add the required hstore and pg_trgm extensions
sudo -u postgres psql discourse_development -c "create extension hstore; create extension pg_trgm"


Clone the repository:



git clone https://github.com/discourse/discourse
cd discourse


Use Bundler to install ruby gems and dependencies including rails:



bundle install


You may run into dependency problems here, as other packages may be needed to build native extensions. If you get yellow text with errors in this step, look at the error messages to figure out which packages to install (with apt-get).



Configure the database data (postgres and redis):



cp config/redis.yml.sample config/redis.yml
cp config/database.yml.sample config/database.yml
# Now edit config/database.yml and in the discourse_development section add
# username: john
# password: whatever
# Follow the format for the other entries (adapter:, database:)


Run the migrations to initialize the database, then seed it:



bundle exec rake db:migrate
bundle exec rake db:seed_fu
sudo -u postgres psql discourse_development < pg_dumps/production-image.sql


then launch the development web server:



bundle exec rails s


Finally, open your browser and connect to the local dev server at



http://localhost:3000

[#30873] Saturday, July 2, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
antoccasiona

Total Points: 430
Total Questions: 127
Total Answers: 131

Location: Netherlands
Member since Sat, Jun 26, 2021
3 Years ago
;