OpenProject - Manual Installation
note
The following instructions is for the version 11.1.3 of OpenProject. The sources mentioned in this guide are available here.
Please be aware that:
- This guide has been tested with (x64) Debian 10, Ubuntu 18.04 and Ubuntu 20.04 installation with administrative rights (i.e. you must be able to sudo).
- OpenProject will be installed with a PostgreSQL database.
- OpenProject will be served in a production environment with the Apache server (should work similarly with other servers, like nginx and others)
The user is the operating system user the command is executed with. In this case it will be root for most of the time or openproject.
1. Create a dedicated OpenProject user#
2. Install the required system dependencies#
3. Install the caching server (memcached)#
4. Install and setup PostgreSQL database server#
OpenProject requires PostgreSQL v9.5+.
Switch to the PostgreSQL system user.
As PostgreSQL user, create the database user for OpenProject. This will prompt you for a password. We are going to assume in the following guide that this password is ‘openproject’, but choose a strong password.
Next, create the database owned by the new user:
Lastly, revert to the previous system user:
5. Installation of Ruby#
The are several possibilities to install Ruby. In this guide we'll use rbenv. Please be aware that the actual installation of a specific Ruby version takes some time to finish.
To check our Ruby installation we run ruby --version. It should output something very similar to:
6. Installation of Node#
The are several possibilities to install Node on your machine: from your distribution repository or manual installation.
6.1 Install from your dist repo (recommended)#
6.2 Manual installation#
We will use nodenv. Please run su openproject --login if you are the root user. If you are already the openproject user you can skip this command. Please be aware that the actual installation of a specific node version takes some time to finish.
6.3 Check node version#
To check our Node installation we run node --version. It should output something very similar to:
7. Installation of OpenProject#
8. Configure OpenProject#
Create and configure the database configuration file in config/database.yml (relative to the openproject directory).
Now we edit the config/database.yml file and insert our database credentials for PostgreSQL. It should look like this (please keep in mind that you have to use the values you used above: user, database and password):
Next we configure email notifications (this example uses a gmail account) by creating the configuration.yml in config directory.
Now we edit the configuration.yml file to suit our needs.
Add (or uncomment) this line into configuration.yml file at the end of the file for a better performance of OpenProject:
NOTE: You should validate your yml files, for example with http://www.yamllint.com/. Both, the database.yml and configuration.yml file are sensitive to whitespace. It is pretty easy to write invalid yml files without seeing the error. Validating those files prevents you from such errors.
9. Finish the installation of OpenProject#
9.1 Secret token#
You need to generate a secret key base for the production environment with ./bin/rake secret and make that available through the environment variable SECRET_KEY_BASE. In this installation guide, we will use the local .profile of the OpenProject user. You may alternatively set the environment variable in /etc/environment or pass it to the server upon start manually in /etc/apache2/envvars.
9.2 Database creation and Assets precompilation#
NOTE: When not specified differently, the default data loaded via db:seed will have an english localization. You can choose to seed in a different language by specifying the language via the LOCALE environment variable on the call to db:seed. E.g.
will seed the database in the french language.
10. Serve OpenProject with Apache and Passenger#
Exit the current bash session with the openproject user, so that we are again in a root shell.
Prepare Apache and Passenger:
The Passenger gem is installed and integrated into Apache:
If you are running on a Virtual Private Server, you need to make sure you have atleast 1GB of RAM before running the passenger-install-apache2-module.
Follow the instructions passenger provides. The passenger installer will ask you the question in “Which languages are you interested in?”. We are interested only in ruby.
The passenger installer tells us to edit the Apache config files. To do this, continue as the root user:
Create the file /etc/apache2/mods-available/passenger.load and add the following line. But before copy & paste the following lines, check if the content (especially the version numbers!) is the same as the passenger-install-apache2-module installer said. When you’re in doubt, do what passenger tells you.
Create the file /etc/apache2/mods-available/passenger.conf with the following contents (again, take care of the version numbers!):
Enable the new configuration:
As the root user, create the file /etc/apache2/sites-available/openproject.conf with the following contents:
Enable the new openproject site (and disable the default site, if necessary):
Restart Apache:
Your OpenProject installation should be accessible on port 80 (http). A default admin-account is created for you having the following credentials:
Username: admin Password: admin
Please, change the password on the first login. Also, we highly recommend to configure the SSL module in Apache for https communication.
11. Activate background jobs#
OpenProject sends (some) mails asynchronously by using background jobs. All such jobs are collected in a queue, so that a separate process can work on them. This means that we have to start the background worker. To automate this we can create some scripts.
11.1 Inbound email#
Create a shell script for inbound emails (e.g., /home/openproject/scripts/inbound_emails.sh):
11.2 Outbound emails#
Create another shell script for outbound emails (e.g., /home/openproject/scripts/outbound_emails.sh):
11.3 Add scripts to crontab#
Put scripts for the background worker into a cronjob:
Add the following entries:
This will start the worker job every minute.
12. Troubleshooting#
You can find the error logs for apache here:
The OpenProject logfile can be found here:
If an error occurs, it should be logged there.
If you need to restart the server (for example after a configuration change), do: