Manual installation
Linux

Ubuntu

36min

Installing Passwork on following OS:

  • Ubuntu 20.04
  • Ubuntu 22.04

On this page you can switch between blocks of code to view the commands applicable to your version of Ubuntu

1. Minimum system requirements

Passwork is not resource-heavy. How much disk space, RAM and CPU power you will need depends on the number of active users, the amount of stored data, and your requirements for fault-tolerance.

If your server has 2-4 GB of RAM, we recommend enabling the SWAP file for libraries to compile properly.

2. Steps before installation

First, gain root access and update the local packages:

bash


Then, install the Git version control package, Apache2 web-server and curl data transfer tool:

bash


3. Installing PHP

Install the software-properties-common package and add the ppa:ondrej/php repository:

Shell


Then update the local packages and repositories:

Shell


And install PHP and its extensions:

Shell


3.1 Installing a PHP MongoDB driver

Install PHP MongoDB driver:

Shell


Create configuration files for PHP MongoDB startup and activation:

Shell


3.2 Installing the PHP Phalcon extension

Install the PHP Phalcon extension:

Shell


Create configuration files for PHP Phalcon startup and activation:

Shell


4. Installing MongoDB database

Download and convert the MongoDB GPG key into a file:

Bash


Add the /etc/apt/sources.list.d/mongodb-org-6.0.list repository line into the file:

Ubuntu 22.04
Ubuntu 20.04


Update the list of available packages:

Shell


Install MongoDB using the apt package manager:

Shell


Run mongod.service:

shell


And enable autostart:

shell


5. Managing and downloading the latest Passwork via Git

Go to /var/www/:

bash


Add a global Git configuration pointing to the safe directory:

bash


Initialize a Git repository at /var/www/:

bash


Add the remote Passwork repository:

bash


Get the remote repository for your local sever:

bash


The system will ask for your credentials, which are listed on your customer portal page. If you can't access the customer portal, let us know.

Switch to the v6 branch with the latest Passwork version:

bash


Give www-data owner privileges for the files and directories:

bash


6. Setting up Apache2 for HTTP access to Passwork

Open the virtual host configuration file for HTTP:

bash


Edit the file so it looks as follows:

bash


Enable the URL rewrite module and restart Apache2:

bash


You can open http://passwork.local or http://127.0.0.1 to test your Passwork connection

7. Passwork parameter checklist

When you connect to Passwork for the first time, you will need to go over the checklist that includes:

  • Automatic parameter checking
  • Checking connection to MongoDB database
  • Generating an encryption key for MongoDB
  • License verification

Leave all fields as they are if you are installing a new Passwork copy

After finishing the checklist, you will be offered to create the first Passwork user and set their login, password and email address for notifications.

Note. This user is always local and "Owner" of Passwork by default, in case of assigning — "Owner" LDAP/SSO user, it will automatically become local and you will not be able to authorise in Passwork

8. Setting up HTTPS connection

8.1 Generating a self-signed SSL certificate

Create a new directory to store the private key and the certificate in:

bash


Use OpenSSL to generate a self-signed X.509 certificate for Apache2:

bash

  • Common Name (CN) — Specify the IP of your server or host. This field is important, as the certificate should match the domain or IP of your website
  • subjectAltName (SAN) — Alternative domain name or IP

Give root access to the user to secure the private key and the certificate:

bash


8.2 Configuring a virtual host to access Passwork via HTTPS

Activate the SSL module in Apache for the server to support HTTPS:

bash


Enable the website's virtual host configuration file with the SSL settings:

bash


Open the virtual host configuration file for HTTPS connection:

bash


Find the section that starts with <VirtualHost _default_:443> and edit it as follows:

  • Add the ServerName directive (server name or IP) and :443 port under the ServerAdmin line:
bash

  • Add the <Directory> directive after ServerName:
bash

  • Locate the following changes and update the paths of files which were generated previously, or specify the private key and certificate location:
bash

  • After editing the file, check if the virtual host configuration file matches the example:
bash


Restart Apache2 to apply the changes:

bash


Check the HTTPS connection to Passwork using https://passwork.local

8.3 Setting up Passwork for work over HTTPS

When using a secure SSL connection (HTTPS), client browsers require certain flags to process Passwork data. These flags are called session.cookie_secure and disableSameSiteCookie. If these flags are not set, browsers will not be able to establish connections and the connection will be rejected, which can lead to authorisation errors — "The session of this browser tab is out of date".

Enable the ;session.cookie_secure parameter in /etc/php/8.2/apache2/php.ini:

bash


Set the disableSameSiteCookie parameter in /var/www/app/config/config.ini to Off:

bash


Do not set these parameters or reset them to their original value if you change your mind about using SSL and work over the HTTP protocol.

9. Configure background tasks

Background tasks are tasks that are executed by the scheduler in the background. For example, LDAP synchronisation, loading favicons, and other tasks that are time-consuming, persistent, or resource-allocating.

See a guide on setting up background tasks.

10. Set up security

Before performing actions to modify and configure security settings, we strongly recommend that you make sure that Passwork is stable and working correctly, and that you back up the files to which you are making changes.

Server security is an important part of ensuring the protection of valuable company data and resources. It is a process that requires planning and execution to ensure maximum protection against various threats.

Look through the overview of Passwork security settings.