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 updatesudo apt-get install apt-transport-https ca-certificates wgetsudo wget -O /etc/apt/trusted.gpg.d/openproject.asc https://dl.packager.io/srv/opf/openproject/keysudo wget -O /etc/apt/sources.list.d/openproject.listhttps://dl.packager.io/srv/opf/openproject/stable/15/installer/ubuntu/22.04.reposudo apt-get updatesudo apt-get install openprojectsudo 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 stopsudo tar xzf attachments-20250306021211.tar.gz -C /var/db/openproject/filessudo tar xzf conf-20250306021211.tar.gz -C /etc/openprojectsudo 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
\qand 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 coresudo snap install --classic certbotsudo certbot certonly --apache- Run through the wizard to install the certificate.
Configure OpenProject
sudo openproject configuresudo 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 yestoserver/ssl no
- Change
sudo openproject configuresudo certbot certonly --apachenano /etc/openproject/installer.dat- Change
server/ssl notoserver/ssl yes
- Change
sudo openproject configure