OpenProject can be challenging to set up. The setup and restore process is a bit more hands on than most Self-Hosted Software Solutions. This guide is to help my future self set up OpenProject on a new server and restore data from a backup.
Install OpenProject
On a fresh install of Ubuntu 22.02 LTS:
sudo apt-get update
sudo apt-get install apt-transport-https ca-certificates wget
sudo wget -O /etc/apt/trusted.gpg.d/openproject.asc https://dl.packager.io/srv/opf/openproject/key
sudo wget -O /etc/apt/sources.list.d/openproject.list
https://dl.packager.io/srv/opf/openproject/stable/15/installer/ubuntu/22.04.repo
sudo apt-get update
sudo apt-get install openproject
sudo openproject configure
- Run through the installation wizard. This will setup the database.
- Get the Postgres Database Connection String.
sudo openproject config:get DATABASE_URL
This will output the database connection string which looks something like:postgres://openproject:password@127.0.0.1:45432/openproject
Import the Files, Configuration, and Git Repository
- Copy all files from the backup directory into the new system. (Attachments, Configuration, Git Repository and Database)
sudo service openproject stop
sudo tar xzf attachments-20250306021211.tar.gz -C /var/db/openproject/files
sudo tar xzf conf-20250306021211.tar.gz -C /etc/openproject
sudo tar xzf git-repositories-20250306021211.tar.gz -C /var/db/openproject/git
Edit The Configuration To Use the New Database Connection String
nano /etc/openproject/conf.d/00_addon_postgres
- Edit this file to use the New Database Connection String from the previous step.
Drop the Database
sudo su - postgres -c psql
- Run the following query:
DROP DATABASE openproject; CREATE DATABASE openproject OWNER openproject;
- To exit postgres, enter
\q
and press enter.
Import the Database
sudo pg_restore --clean --if-exists --dbname $(sudo openproject config:get DATABASE_URL) postgresql-dump-20250306021211.pgdump
Install Certbot
sudo snap install core; sudo snap refresh core
sudo snap install --classic certbot
sudo certbot certonly --apache
- Run through the wizard to install the certificate.
Configure OpenProject
sudo openproject configure
sudo service openproject start
This should be all that is required.
Troubleshooting
If for whatever reason Certbot can't set up the certificate and OpenProject won't start perform the following actions
nano /etc/openproject/installer.dat
- Change
server/ssl yes
toserver/ssl no
- Change
sudo openproject configure
sudo certbot certonly --apache
nano /etc/openproject/installer.dat
- Change
server/ssl no
toserver/ssl yes
- Change
sudo openproject configure