First, you will need to log in to your Ubuntu 22.04 VPS via SSH as the root user:<\/p>\n
ssh root@IP_Address -p Port_number<\/pre>\nYou will need to replace ‘IP_Address’ and ‘Port_number’ with your server’s respective IP address and SSH port number. Additionally, replace ‘root’ with the username of the system user with sudo privileges.<\/p>\n
You can check whether you have the proper Ubuntu 22.04 installed on your server with the following command:<\/p>\n
# lsb_release -a<\/pre>\nIt will return an output like this.<\/p>\n
No LSB modules are available.\r\nDistributor ID: Ubuntu\r\nDescription: Ubuntu 22.04 LTS\r\nRelease: 22.04\r\nCodename: jammy<\/pre>\n<\/p>\n
<\/p>\n
<\/p>\n
<\/p>\n
We will use \u2018root\u2019 to run the shell commands throughout this article. If you want to use your regular system user with sudo privileges to run the commands, make sure to append \u2018sudo\u2019 in front of the commands.<\/p>\n
<\/span>Step 2. Install Docker<\/span><\/h2>\nThere are several methods to install OpenProject on Ubuntu. The developers themselves recommend installing it using their DEB or RPM packages. But, since the DEB installer for Ubuntu 22.04 is not released at the moment, we are going to install OpenProject using docker. It is also possible to install OpenProject manually; however, this method is not recommended, especially for production websites. Let’s start this by installing Docker.<\/p>\n
# apt install docker.io -y<\/pre>\nThe command above will install docker from the Ubuntu repository.<\/p>\n
<\/span>Step 3. Install OpenProject<\/span><\/h2>\nTo ensure that our data is not lost when restarting the OpenProject docker container, we can create a directory on our VPS where all this data will be stored. Let’s run the command below to create the local directories where the data will be stored across container restarts, and start the container with those directories mounted:<\/p>\n
# mkdir -p \/opt\/openproject\/{pgdata,assets}<\/pre>\nThe fastest way to get an OpenProject instance up and running is to install it on an all-in-one container. You can run this command below; it will take some time to finish.<\/p>\n
# docker run -d -p 8080:80 --name openproject -e SERVER_HOSTNAME=openproject.example.com -e SECRET_KEY_BASE=mCIj3APuCIvxyR0G5lmNSzbDbxB4vjRJ -v \/opt\/openproject\/pgdata:\/var\/openproject\/pgdata -v \/opt\/openproject\/assets:\/var\/openproject\/assets openproject\/community:12<\/pre>\nYou will get an output similar to this.<\/p>\n
<\/p>\n
<\/p>\n
<\/p>\n
<\/p>\n
<\/p>\n
<\/p>\n
<\/p>\n
<\/p>\n
<\/p>\n
Please make sure you replace the SERVER_HOSTNAME value with your own server’s hostname and SECRET_KEY_BASE with your own value as well. To get a random string for SECRET_KEY_BASE, you can run this command:<\/p>\n
# tr -dc A-Za-z0-9 <\/dev\/urandom | head -c 32 ; echo ''<\/pre>\nAfter running the ‘docker run’ command above, your OpenProject instance will run. To check this, you can run ‘docker ps’ or ‘docker container ls’ command<\/p>\n
<\/p>\n
<\/p>\n
<\/p>\n
As you can see, the docker container is called ‘openproject,’ so we can run these commands to start or stop the service.<\/p>\n
# docker stop openproject\r\n# docker start openproject<\/pre>\n<\/span>Step 4. Install Apache<\/span><\/h2>\nOpenProject has been installed, and it is now running on port 8080. To access it using your domain or subdomain, we can use a webserver to act as a reverse proxy. In this tutorial, we will use apache as the reverse proxy.<\/p>\n
# apt install apache2<\/pre>\nOn Ubuntu, the services we install will run immediately upon installation. So, apache is now running, and we need to enable some apache modules to proceed with this.<\/p>\n
# a2enmod proxy_http headers rewrite<\/pre>\nThen, let’s restart apache after enabling the modules.<\/p>\n
# systemctl restart apache2<\/pre>\nTo configure the reverse proxy, we can create a new virtual host.<\/p>\n
# nano \/etc\/apache2\/sites-available\/openproject.yourdomain.com.conf<\/pre>\nPaste the following lines into the file.<\/p>\n
<VirtualHost *:80>\r\nServerName openproject.yourdomain.com\r\n\r\nRewriteEngine on\r\nRewriteRule \"^$\" \"\/\" [R,L]\r\n\r\nProxyRequests off\r\n\r\n<Location \"\/\">\r\nProxyPreserveHost On\r\nProxyPass http:\/\/127.0.0.1:8080\/\r\nProxyPassReverse http:\/\/127.0.0.1:8080\/\r\n<\/Location>\r\n\r\n<\/VirtualHost><\/pre>\nMake sure you replace openproject.yourdomain.com<\/em> in the file name and its content with your actual domain or subdomain. Save the file, then exit.<\/p>\nAfter creating a virtual host, we can proceed with activating it and reloading apache.<\/p>\n
# a2ensite openproject.yourdomain.com\r\n# systemctl reload apache2<\/pre>\nThat’s it. You should now be able to access your OpenProject website at http:\/\/openproject.yourdomain.com and log in using the default ‘admin’ as both username and password.<\/p>\n
<\/p>\n
<\/p>\n
<\/p>\n
<\/p>\n
<\/p>\n
<\/p>\n
<\/p>\n
<\/p>\n
<\/p>\n
<\/p>\n
<\/p>\n
When opening OpenProject for the first time, you will be forced to change the admin’s default password to a stronger one.<\/p>\n
<\/p>\n
<\/p>\n
<\/p>\n
<\/p>\n
<\/p>\n
<\/p>\n
<\/p>\n
<\/p>\n
Then, you will also see a message like this:<\/p>\n
Your application is running with its host name setting set to localhost:3000, but the request is a openproject.yourdomain.com hostname. This will result in errors! Go to System settings and change the \"Host name\" setting to correct this.<\/pre>\nYou can go to the System Settings page and change the hostname to the domain\/subdomain you use to access your OpenProject instance.<\/p>\n