Skip to content


How to install Redmine 1.1.2 on Ubuntu Server 10.04

Redmine is an excellent project management tool written using Ruby on Rails. It provides everything you need to organise your workplace or personal projects. Once you see it working you definitely will want to use it on your own projects. Everything is great until you want to install it since redmine only works with very specific versions of its dependencies. There are many steps that you need to take into consideration, even if you install the outdated version in the repositories. In this guide, I will show you how to install redmine 1.1.2 (the latest version at the time of writing) on Ubuntu Server 10.04 32 bits (latest LTS version at the time of writing).

Make sure that you installed Ubuntu Server 10.04 with SSH (optional) and LAMP support. Both can be selected to be automatically installed at the end of the normal Ubuntu Server 10.04 installation. Once it is installed, remember to update and upgrade your system.

sudo apt-get update
sudo apt-get upgrade

First, let’s install some dependencies:

sudo apt-get install ruby1.8-dev rubygems1.8 libmysql-ruby libmysqlclient-dev rake libopenssl-ruby libapache2-mod-passenger imagemagick libmagickcore-dev libmagickwand-dev

Now we can install the required packages for ruby, or gems. Note that some packages will take a long time to install and provide no output, so just be patient. Also, you will see some warnings like No definition for X. Ignore those, they mean that some documentation was not installed, and we can live with that.

sudo gem install rails -v=2.3.5
sudo gem install mysql
sudo gem install ruby-openid
sudo gem install i18n -v=0.4.2
sudo gem install passenger
sudo gem install rmagick

Now we have to prepare the database. Enter the MySQL console as root:

mysql -uroot -p

Provide the root password. This is the password you set in the early LAMP installation. Now, inside the MySQL console, execute these commands:

create database redmine character set utf8;
create user 'redmine'@'localhost' identified by 'myPassword';
grant all privileges on redmine.* to 'redmine'@'localhost';
exit

Remember to change myPassword with your actual password. This is the one that will be used for the user redmine in the database redmine at localhost.

Now it is time to get the redmine code. Execute the following commands to get redmine 1.1.2.

cd ~
wget http://rubyforge.org/frs/download.php/74419/redmine-1.1.2.tar.gz
tar -xvzf redmine-1.1.2.tar.gz
cd redmine-1.1.2

Now setup the database configuration file to match our current environment:

cp config/database.yml.example config/database.yml
nano config/database.yml

Put the details of the database on the specific fields, in particular username and password. Username should be redmine and password should be myPassword or the one you provided before. Make sure that you change both, production and development sections. When you are finished, just hold Control and then press X. This is the command for exiting nano. It will ask if you want to save the changes, just press y (as in yes) and hit enter. That’s it, file saved and back to the console.

Now do the same for configuring email:

cp config/email.yml.example config/email.yml
nano config/email.yml

For this example, we are going to use gmail, but you can use any email settings that you need. Make sure that address is smtp.gmail.com, port is changed to 587, domain is set to gmail.com (or your host if you use google apps) and that the user_name and password are your credentials. Also, make sure that you add a tls: true line. And finally, the most important part, is that you change login with plain in authentication.

production:
 delivery_method: :smtp
 smtp_settings:
 address: smtp.gmail.com
 port: 587
 tls: true
 domain: gmail.com # or your domain
 authentication: :plain
 user_name: fancyUsername@gmail.com # or your domain
 password: secretPassword

For gmail to work, we need to install a script. Let’s get it:

sudo apt-get install git-core
ruby script/plugin install git://github.com/collectiveidea/action_mailer_optional_tls.git

Let’s proceed with the installation:

rake generate_session_store
sudo mkdir /opt/redmine
cd /opt/redmine
sudo cp -r ~/redmine-1.1.2 .
cd redmine-1.1.2
sudo RAILS_ENV=production rake db:migrate
sudo RAILS_ENV=production rake redmine:load_default_data

Press enter to accept the default language (English) and then execute the following:

sudo chown -R www-data:www-data files log tmp public/plugin_assets
sudo chmod -R 755 files log tmp public/plugin_assets
sudo nano /etc/apache2/mods-available/passenger.conf

Add this line inside the <IfModule mod_passenger.c> tag:

PassengerDefaultUser www-data

Now let’s configure apache:

sudo nano /etc/apache2/sites-available/default

Just before the closing tag, </VirtualHost>, add the following:

RailsEnv production
RailsBaseURI /redmine

Now we put a link to our application to be accessible from apache and restart it:

sudo ln -s /opt/redmine/redmine-1.1.2/public /var/www/redmine
sudo /etc/init.d/apache2 restart

Some clean up…

cd ~
rm -r redmine-1.1.2
rm redmine-1.1.2.tar.gz

The installation process is finished. Open a web browser in another computer and go to yourServerIP/redmine and you should see the initial page of redmine. If it does not show, then something is wrong in your installation. Go back and carefully follow the steps from the beginning. If you do not know your IP address, just run ifconfig from the server.

Click on Sign-in. Enter admin for user and password. Now you are logged in as the redmine administrator. Go to Administration and then click on Information. You should see the following:

Note that Redmine 1.1.2 stable is installed correctly with RMagick and the directories that it needs are writeable. The only thing left to do here is to change the details of the administrator account (that is why there is one error sign), and start creating users and projects and manage them with this great tool. Once you change your administrator account, you should see no errors on the information page:

And now you can enjoy all the features of this great project manager: Gantt charts, Roadmaps, wiki, file repositories, multiple project support, forums, and much more…

Posted in Open Source, Programming.


15 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.

  1. ensienne says

    Hello, I have a question please: I have followed all steps but when in the step:

    sudo RAILS_ENV=production rake db:migrate
    I have this error:

    (in /opt/redmine/redmine-1.1.2)
    rake aborted!
    syntax error on line 73, col 0: `production:’

    (See full trace by running task with –trace)
    How can I resolve it?
    thank you for your help

  2. Imran says

    Enstenne you should have to mv /opt/redmine/redmin-1.1.2/* to /opt/redmine
    and then cd /opt/redmine and run the sudo RAILS_ENV=production rake db:migrate
    hope so it will work.

    sysadmin@personforce.net for further assistance.

  3. kevin says

    Thx a lot for the tutorial !!

    All work at home ! i’ll try it at office tomorrow !!

  4. Fipo says

    Hey,
    Thanks for great tutorial ;)

    You make my life easier :)

    Regards

  5. Roberto says

    Hi Sebastian,
    I have followed all steps but when in the step “cp config/email.yml.example config/email.yml”, I have the following error:
    “cannot stat ‘config/email.yml.example’: no such file or directory”.
    How can I resolve it?
    Thank in advance for your help.

  6. samontab says

    Roberto, make sure that you follow each step carefully, line by line on a fresh Ubuntu Server 10.04. It should just work.

    The previous step of the tutorial takes you to the correct directory (redmine-1.1.2)
    Make sure that you run the previous command cd redmine-1.1.2 before running cp config/email.yml.example config/email.yml

    That is the only explanation I can think of since the config/email.yml.example file is included in the compressed file you just downloaded…

  7. Colombian folk says

    Thanks men!

  8. Venkat says

    Great tutorial.It was clearly explained. Thank you very much.

  9. Gustavo Pereira says

    Perfect Tutorial, thank you so much!
    It works for me.

  10. Simei Tabordes Gonçalves says

    After like 12h trying over 5 guides, finally i found yours, and it worked!
    Just was using a virtual machine on vmware with a default configuration on a snapshot to roll back when things turned black.

    In my real server the gem list was:

    actionmailer (2.3.5)
    actionpack (2.3.5)
    activerecord (2.3.5)
    activeresource (2.3.5)
    activesupport (2.3.5)
    daemon_controller (1.0.0)
    fastthread (1.0.7)
    i18n (0.4.2)
    mysql (2.8.1)
    passenger (3.0.11)
    rack (1.0.1)
    rails (2.3.5)
    rake (0.8.7)
    rmagick (2.13.1)
    ruby-openid (2.1.8)
    rubygems-update (1.3.7)

    with ubuntu 11.04

    on my virtual machine gem list was

    actionmailer (2.3.5)
    actionpack (2.3.5)
    activerecord (2.3.5)
    activeresource (2.3.5)
    activesupport (2.3.5)
    daemon_controller (1.0.0)
    fastthread (1.0.7)
    i18n (0.4.2)
    mysql (2.8.1)
    passenger (3.0.11)
    rack (1.0.1)
    rails (2.3.5)
    rake (0.9.2.2)
    rmagick (2.13.1)
    ruby-openid (2.1.8)

    with 10.04 ubuntu

    Thanks for help!

  11. Jacob Marshall says

    Ive gotta give you props for this! This is one of the best tutorials ive ever followed, worked like a charm! Its one of those tutorials that you dont really need to change anything.

    Grats and thanks!

  12. mikesilence says

    Hey! I use this tutorial step by step
    But Redmine type error:

    Cannot start Ruby on Rails application
    The directory “/var/www” does not appear to be a valid Ruby on Rails application root.

  13. samontab says

    Since others and I have successfully installed it using this guide, I assume that you missed a step.
    Please take a second or third look, and come back if you still need more information.
    Just do exactly what it says, line by line.

  14. Merlin says

    Hi,
    I followed all the steps and managed to execute without any errors…but when I tried to open the application, there’s an error 404 Page Not Found (requested url not found on this server)…Please help???!!!

Continuing the Discussion

  1. Redmine auf einem Strato V-Server installieren « shinpei – Blog linked to this post on May 31, 2011

    […] weggelassen werden (kann hier nur nicht anders geschrieben werden. P.S: das Tutorial basiert auf: Link Computer ← OpenSwift für GT540 Subversion unter Ubuntu → LikeSei der […]



Some HTML is OK

or, reply to this post via trackback.