Legacy
Passwork 4

Docker

31min

How to install Passwork using Docker

Please pay your attention, this Docker-compose build is for Linux.

Docker installation

Get root privileges and update packages info:

Shell


Install Git

Shell


Load configuration files

Create a new directory /server and clone configuration files from public git repository:

Shell


Download Passwork Sources

Remove file from the destination folder:

Shell


Clone the repository using your login and password:

Shell


💡 The system will ask for a login and password to the repository, which you can find in your Customer Portal. If you don't have access to the Customer Portal, contact us.

Change directory to Docker Compose

Shell


Start Docker Compose

Shell


Check that all containers are running:

Shell


Installation

When you open Passwork for the first time, you will see an installation wizard that will check if the server is configured correctly and allow you to enter the basic parameters.

💡 If you are installing a new copy of Passwork, leave all fields in their default values, except for the database connection string. In it, you need to change localhost to db.

Document image


Sign up an administrator

Enter the username and password for the first user. The user will automatically become the administrator and owner of the organization.

Mail Configuration

Nginx container uses Postfix for sending mail. All configuration files you can find here:

Shell


Edit them to suit your needs. Restart Postfix for the changes to take effect.

Shell


Example for Configuring Postfix

Open the configuration file  /server/conf/postfix/main.cf.

Shell


Make sure the myhostname parameter matches the fully qualified domain name of your server:

Shell


Configuring SMTP names and passwords.

Open or create the file /server/conf/postfix/sasl_passwd.

Shell


Add SMTP host, username and password should be written in the following format:

Shell


If you want to use a non-standard TCP port (for example 587) use the following format:

Shell


For Gmail, the entry will look like this:

Shell


Create a hashed database for Postfix, run the postmap command:

Shell


After successful execution of the command, a new file sasl_passwd.db should appear in the /server/conf/postfix directory.

Protecting the password file and the hash file.

The files /server/conf/postfix/sasl_passwd and /server/conf/postfix/sasl_passwd.db created in the previous steps contain your SMTP credentials in plain text. For security reasons, you should change the permissions on them so that only the root user can read and write to the file.

Run the following commands to change the owner of the files to root and update the file permissions:

Shell


Server Relay Configuration

Open the file /server/conf/postfix/main.cf.

Shell


Change the relayhost parameter to your external SMTP relay. If a non-standard TCP port was specified in the sasl_passwd file, then you must use the same port when configuring the relayhost parameter.

Specify SMTP relay:

Shell


For Gmail, the entry will look like this:

Shell


At the end of the file, add the following parameters to enable authentication:

Shell


Save the changes.

Restart Postfix:

Shell


Useful commands

Copy dexec utility:

Shell


Bash to container:

Shell


Restore correct permissions:

Shell


Reload Nginx without stopping:

Shell


Docker containers run with autostart feature. It means that Docker automatically launches containers again if a root process is down (the roots process are nginx and mongodb).

If you need to stop container you need to disable the autostart feature before:

Shell


Don't forget to enable the autostart:

Shell


When the containers are not autostartable you can forcse stop the services:

Shell


If the containers are autostartable these commands just restart the services.

Use it in emergency case because it can corrupt containers data.

Structure of files

Configuration files:

Shell


Data (mongo database):

Shell


Logs:

Shell


Web-site:

Shell


Example: How to edit nginx/php configuration

Edit configuration files:

Shell


Restart nginx and php-fpm:

Shell