Skip to content

Instantly share code, notes, and snippets.

@rotexdegba
Last active January 19, 2026 20:30
Show Gist options
  • Select an option

  • Save rotexdegba/e39b6b4f85ac580fe5e0434dbb00beb0 to your computer and use it in GitHub Desktop.

Select an option

Save rotexdegba/e39b6b4f85ac580fe5e0434dbb00beb0 to your computer and use it in GitHub Desktop.
Installing Rails and Redmine in Ubuntu 16.04 LTS / Linux Mint 18
sudo apt install rails
  • install common dependencies
sudo apt-get install build-essential patch ruby-dev zlib1g-dev liblzma-dev make libmysqlclient-dev imagemagick \
libmagickcore-dev libmagickwand-dev
  • install passenger mod for apache to run rails
sudo apt-get install libapache2-mod-passenger

sudo mkdir -p /opt/redmine

download redmine and move it (e.g sudo mv /download/path/redmine-3.3.1 /opt/redmine/) to /opt/redmine so we get some thing like /opt/redmine/redmine-3.3.1 then cd /opt/redmine/redmine-3.3.1

  • Run the SQL statement below; Don't forget to replace your_password_here with the password that you specified in the config/database.yml file while you were configuring the database for Redmine.
CREATE DATABASE redmine CHARACTER SET UTF8;
CREATE USER 'redmine'@'localhost' IDENTIFIED BY 'your_password_here';
GRANT ALL PRIVILEGES ON redmine.* TO 'redmine'@'localhost';
sudo mv ./config/database.yml.example ./config/database.yml
  • edit ./config/database.yml with the correct db credential values
sudo gem install bundler

bundle install --without development test
  • create a secret token for the Redmine session
bundle exec rake generate_secret_token
  • Next, we need to create the structure (tables, indexes, and so on) of the Redmine database:
RAILS_ENV=production bundle exec rake db:migrate
  • Finally, we need to insert initial data (such as trackers, the administrator account, and so on) into the database:
RAILS_ENV=production bundle exec rake redmine:load_default_data
  • Now Configure Apache
cd /etc/apache2
  • Now, create the redmine.conf file in the sites-available subdirectory with the following content (do this under root):
<VirtualHost *:3000>
        RailsEnv production
        DocumentRoot /opt/redmine/redmine-3.2.0/public
        <Directory "/opt/redmine/redmine-3.2.0/public">
                Allow from all
                Require all granted
        </Directory>
</VirtualHost>
  • This is the configuration of the virtual host that will run Redmine. However, this is not the only virtual host that we currently have.
  • Please note that Redmine, which is installed and configured this way, is going to run from your user account.
  • If you prefer to use another user, www-data, for example, you need to add PassengerDefaultUser www-data
  • to your virtual host configuration, and change the owner of the redmine-3.2.0 directory by executing
chown www-data:www-data /opt/redmine/redmine-3.2.0 -R.
  • enable the redmine.conf
sudo a2ensite redmine
  • add port 3000 to the /etc/apache2/ports.conf file like so:
Listen 3000
  • restart apache
sudo service apache2 reload

Good books for redmine:

@leguminator
Copy link

Thanks for that precious, clean, neat and precise installation procedure !
Should be referenced directly by redmine.org ;)

@mihaikelemen
Copy link

mihaikelemen commented Mar 24, 2018

Very nice.

One thing on downloading redmine, the svn can be used to grab the files: svn co https://svn.redmine.org/redmine/branches/3.4-stable /opt/redmine (assuming that svn is available on the server, if not just run apt -y install subversion)

@RecNes
Copy link

RecNes commented Jun 13, 2018

You have to change extension to .txt, .sh extension has made me to try run this as shell script but it's failed.

@6temflex
Copy link

Hi
do you know id we have to do it with a specific user ?

@galch99
Copy link

galch99 commented Dec 3, 2023

Hello,
Yaay, pro soltuon. :D

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