NavigationContentFooter
Jump toSuggest an edit

Deploying OpenProject with a Database for PostgreSQL

Reviewed on 12 August 2024Published on 23 July 2020
  • OpenProject
  • database
  • PostgreSQL
  • ubuntu

OpenProject is an open-source project management software. Available in more than 30 languages, it provides tools and features to assist teams with communication, collaboration, and navigating the lifecycle of a project.

The software helps users to organize projects from their initial stages of conception, initiation, definition and planning, to their launch or execution and provides tools for project performance, control, and closure.

In this tutorial, you will learn how to install and configure OpenProject on an Instance running Ubuntu Focal Fossa 20.04 while integrating a PostgreSQL Database into your stack.

Before you start

To complete the actions presented below, you must have:

  • A Scaleway account logged into the console
  • Owner status or IAM permissions allowing you to perform actions in the intended Organization
  • An SSH key
  • An Instance running on Ubuntu 22.04 (Jammy)
  • sudo privileges or access to the root user
  • Configured an A-record pointing to your Instance’s IP address

Installing OpenProject

  1. Connect to your Instance via SSH.
  2. Update and upgrade the system to the latest version available in Ubuntus repositories. Then, install the apt-transport-https package, which allows the use of repositories accessed via the HTTP Secure protocol (HTTPS).
    apt update && apt -y upgrade
    apt -y install apt-transport-https ca-certificates wget
  3. Use the following command to import the PGP key used to sign Open Project packages:
    sudo wget -O /etc/apt/trusted.gpg.d/openproject.asc https://dl.packager.io/srv/opf/openproject/key
    Note

    If you are using sudo to launch commands with administrator permissions, your password will be requested.

  4. Add the OpenProject repository:
    wget -O /etc/apt/sources.list.d/openproject.list \
    https://dl.packager.io/srv/opf/openproject/stable/12/installer/ubuntu/22.04.repo
  5. Update the apt package list and install the OpenProject Community Edition.
    apt-get update
    apt-get -y install openproject

Creating a database for PostgreSQL

Since OpenProject requires a PostgreSQL database to run, we will be creating a Database for the PostgreSQL instance directly in the Scaleway console.

Follow the instructions to create a Database Instance. Ensure that you select PostgreSQL as the database engine.

Configuring the stack

You can easily configure your stack and dependencies with OpenProject’s installer. Carry out the following commands from your Instance.

  1. Run the following command to open the installer:

    openproject configure
  2. Select the Use an existing PostgreSQL database option to use your Database for PostgreSQL.

  3. Insert the database IP. This is found in your Database Instance’s Overview tab, under Endpoint, and is the sequence of numbers before the :.

  4. Enter the PostgreSQL port. This is found in your Database Instance’s Overview tab, under Endpoint, and is the sequence of numbers before the :.

  5. Insert the username created for your Database.

    And the corresponding password:

  6. Enter the name of your Database Instance (displayed at the top of its Overview* page, or in the list of your Databases):

    The installer offers the option of installing and configuring a web server using Apache.

  7. Select Install apache2 server and press enter.

  8. Insert the domain name pointed toward your Instance.

  9. Set a path prefix. If you leave the field empty, the installation will be performed on the root of your domain.

    The wizard will then ask if you wish to enable SSL/TLS.

  10. Proceed by selecting No and pressing enter.

    Note

    We will enable TLS to secure and encrypt connections between your users and the instance in a later step.

  11. Choose between configuring Apache to automatically create and host SVN or Git repositories. If you wish to use SVN, select Install Subversion repository support. If you wish to use Git, select Skip and then Install Git repository support.

    In this tutorial, we will install Git.

  12. Enter the path to the directory that hosts the Git repositories and then the path to the git http backend CGI directory.

  13. Select an e-mail application you wish to use to send e-mails from OpenProject and fill in the requested information or Skip.

  14. Finally, install the Memcache server.

    The installation completes.

You can access your OpenProject interface through the address http://<yourdomain.name>/<yourpathprefix> on the web browser.

Installing an SSL/TLS certificate

To protect user’s credentials and other confidential information that will be stored in OpenProject, you can generate an SSL certificate issued by Let’s Encrypt for free.

For this purpose, we will be using a certbot.

  1. Make sure the universe repository is enabled in Ubuntu.

    apt-get update
    apt-get install software-properties-common
    add-apt-repository universe
    apt-get update
  2. Install certbot by running the command:

    apt-get install certbot
  3. Run certbot while specifying the webroot path as such:

    certbot certonly --webroot --webroot-path /opt/openproject/public -d domain.name

    Replace domain.name by your domain name.

  4. Answer the questions when prompted by the certbot Wizard.

    Enter email address (used for urgent renewal and security notices) (Enter 'c' to
    cancel):

    Insert your e-mail address.

    Please read the Terms of Service at
    https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf. You must
    agree in order to register with the ACME server at
    https://acme-v02.api.letsencrypt.org/directory
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    (A)gree/(C)ancel: A

    Type A to agree.

    Would you be willing to share your email address with the Electronic Frontier
    Foundation, a founding partner of the Let's Encrypt project and the non-profit
    organization that develops Certbot? We'd like to send you an email about our work
    encrypting the web, EFF news, campaigns, and ways to support digital freedom.
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    (Y)es/(N)o:

    Choose Yes or No and input accordingly.

    The Wizard will then generate your certificate. Once done, it will provide you with the path of the certificate and the private key, as well as inform you of the expiration date of the certification.

    Obtaining a new certificate
    Performing the following challenges:
    http-01 challenge for openproject-scw.ga
    Using the webroot path /opt/openproject/public for all unmatched domains.
    Waiting for verification...
    Cleaning up challenges
    IMPORTANT NOTES:
    - Congratulations! Your certificate and chain have been saved at:
    /etc/letsencrypt/live/yourdomain.name/fullchain.pem
    Your key file has been saved at:
    /etc/letsencrypt/live/yourdomain.name/privkey.pem
    Your cert will expire on 2020-10-20. To obtain a new or tweaked
    version of this certificate in the future, simply run certbot
    again. To non-interactively renew *all* of your certificates, run
    "certbot renew"
    - Your account credentials have been saved in your Certbot
    configuration directory at /etc/letsencrypt. You should make a
    secure backup of this folder now. This configuration directory will
    also contain certificates and private keys obtained by Certbot so
    making regular backups of this folder is ideal.

    Take note of the paths provided as they will be required in a later step.

Enabling TLS/SSL

  1. Re-launch the OpenProject installer by running the command:

    openproject reconfigure

    The installation Wizard launches the same prompts as before. Select the same preferences and enter your answers, if necessary, until you reach the server/ssl screen.

  2. Select Yes and enter. When prompted, insert the path to your certificate:

    To your private key:

    And a path to your CA bundle (if you have one).

Follow through the remaining prompts by entering < OK > every time. The wizard will close, and your new configuration will be applied.

Accessing your OpenProject dashboard

To begin editing and configuring your OpenProject workspace you must log in.

  1. Open a web browser and enter https://<yourdomain.name>/<yourpathprefix>/login.
    Tip

    If you can’t reach the application from your browser, try running the following command to start the service:

    service openproject start
  2. Enter the following credentials to log in as the admin user:
    Username: admin
    Password: admin
    Upon the first login, you will be required to change your password.

Once you have done so, you can begin managing your projects. OpenProject provides a documentation website and a user guide is available to help you get started with their different features.

API DocsScaleway consoleDedibox consoleScaleway LearningScaleway.comPricingBlogCareers
© 2023-2024 – Scaleway