Hello and thank you for visiting our website. In today’s article we cover the installation, configuration and running of Mayan EDMS in Docker Containers. Mayan EDMS and Open Source and free to use Electronic Document Management System written in Python language using the Django web application framework. The software is released under the Apache 2.0 License. Mayan aims at providing a repository or an electronic vault for all your electronic documents. Using Docker image is the easiest way to use Mayan EDMS.

For list of features that comes with Mayan EDMS, visit its official features documentation.

1) Installation Requirements

For all deployment methods, Mayan EDMS has the following recommended set of requirements:

  • Minimum RAM of 4 GB.
  • A 64 bit CPU, 4 cores or more, 2 GHz or faster
  • PostgreSQL 13 or later Database system
  • GNU/Linux distributions or operating systems platform with Docker & Docker Compose support.
  • Access to the system as user with administrative privileges

2) Install Docker Engine

Make sure Docker is installed properly and working on your host system before attempting to install Mayan EDMS. Refer to our article on the installation of Docker:

After the installation of Docker, we can confirm it works by checking on the versions of Engine and Compose.

$ docker --version
Docker version 24.0.5, build ced0996

$ docker compose version
Docker Compose version v2.20.2

3) Clone Mayan EDMS Code

Mayan EDMS files are located at: https://gitlab.com/mayan-ed.ms/mayan-edms/-/tree/master/docker/. We can download it locally.

git clone https://gitlab.com/mayan-edms/mayan-edms.git

The docker subdirectory contains the compose file.

Mayan EDMS Source

Navigate to docker directory.

cd mayan-edms/docker/

4) Create Mayan EDMS Customizations

You can add an entry for each of the environment variables to change inside .env file.

vim .env

In our example we updated below variables.

MAYAN_DATABASE_NAME=edms
MAYAN_DATABASE_PASSWORD=StrongDBPassword
MAYAN_DATABASE_USER=edms
MAYAN_ELASTICSEARCH_PASSWORD=StrongELPassword
MAYAN_RABBITMQ_USER=edms
MAYAN_RABBITMQ_PASSWORD=StrongMQPassword
MAYAN_RABBITMQ_VHOST=/edms
MAYAN_REDIS_PASSWORD=StrongRedisPassword

The default compose project name is named mayan and can be updated.

COMPOSE_PROJECT_NAME=mayan

To confirm configuration changes run:

docker compose --file docker-compose.yml --project-name mayan config

5) Launch Mayan EDMS Docker containers

Once done with the customizations start all Mayan EDMS containers.

$ docker compose up -d
[+] Running 4/0
 ✔ Container mayan-redis-1       Running                                                                                                                                                         0.0s
 ✔ Container mayan-rabbitmq-1    Running                                                                                                                                                         0.0s
 ✔ Container mayan-app-1         Running                                                                                                                                                         0.0s
 ✔ Container mayan-postgresql-1  Running

To check on the status of the container run:

$ docker ps
CONTAINER ID   IMAGE                                COMMAND                  CREATED        STATUS        PORTS                                                                  NAMES
86f2e85204ea   rabbitmq:3.11.13-management-alpine   "docker-entrypoint.s…"   12 hours ago   Up 12 hours   4369/tcp, 5671-5672/tcp, 15671-15672/tcp, 15691-15692/tcp, 25672/tcp   mayan-rabbitmq-1
b78c36da3752   redis:7.0.10-alpine                  "docker-entrypoint.s…"   12 hours ago   Up 12 hours   6379/tcp                                                               mayan-redis-1
c9e19096b579   postgres:13.10-alpine                "docker-entrypoint.s…"   12 hours ago   Up 12 hours   5432/tcp                                                               mayan-postgresql-1
cdf73c48b96e   mayanedms/mayanedms:s4.4             "/usr/local/bin/entr…"   12 hours ago   Up 12 hours   0.0.0.0:80->8000/tcp, :::80->8000/tcp                                  mayan-app-1

Or use

docker compose ps

Listing created volumes.

$ docker volume ls
DRIVER    VOLUME NAME
local     mayan_app
local     mayan_postgres
local     mayan_rabbitmq
local     mayan_redis

Created network for Mayan EDMS.

$ docker network ls
NETWORK ID     NAME          DRIVER    SCOPE
25cf8cc0d317   bridge        bridge    local
bcb34458e540   host          host      local
46bc54f81680   mayan_mayan   bridge    local
1f8a758c9005   none          null      local

To view container logs use:

docker compose logs

You can access Mayan EDMS web interface on http://serverip_or_fqdn

6) Configuring Nginx as Proxy

Traefik is supported Proxy is supported natively in Mayan EDMS and can be enabled in .env configurations. For simplicity of administration we’re using Nginx Proxy server.

Begin with the installation of nginx

### Debian based systems ###
sudo apt install nginx

### RHEL based systems ###
sudo yum install nginx

Change Mayan EDMS listen port from 80 to 8080.

$ vim .env
MAYAN_FRONTEND_HTTP_PORT=8080

Restart Mayan containers.

docker compose down && docker compose up -d

Confirm Mayan Frontend container is listening on port 8080 on the host.

$ docker ps|grep mayan-app-1
958df04e8459   mayanedms/mayanedms:s4.4             "/usr/local/bin/entr…"   17 seconds ago   Up 16 seconds   0.0.0.0:8080->8000/tcp, :::8080->8000/tcp

Now create mayan.conf nginx configuration file:

sudo vim /etc/nginx/conf.d/mayan.conf

If not using SSL below configuraions can be used.

server {
    listen 80 ;
    server_name edms.example.net ;
    location / {
        proxy_pass http://127.0.0.1:7880;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header X-Forwarded-Host   $host;
    }
}

Using Let’s Encrypt / Any other SSL

Your Nginx configuration file will look like below:

server {
    listen 80 ;
    server_name edms.example.net ;
    location / {
        return 301 https://$host$request_uri;
    }
}
server {
    listen 443 ssl http2 ;
    server_name edms.example.net ;
    access_log /var/log/nginx/mayan.log;
    error_log /var/log/nginx/mayan_error.log;
    client_max_body_size 50M;  # Increase to upload bigger documents
    ssl_certificate /etc/letsencrypt/live/edms.example.net/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/edms.example.net/privkey.pem;
    ssl_trusted_certificate /etc/letsencrypt/live/edms.example.net/fullchain.pem;
    location / {
        proxy_pass http://127.0.0.1:8080;
        proxy_redirect off;
        proxy_read_timeout 60s; # Increase if your doc uploads take more than 60 sec

        proxy_http_version 1.1;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_pass_header Set-Cookie;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header X-Forwarded-Host   $host;
        proxy_set_header X-Forwarded-Port   443;
        proxy_set_header X-Forwarded-Proto  https;
    }
}

To generate Let’s Encrypt SSL see our guides below:

7) Access Mayan EDMS on Web Console

Access Mayan EDMS securely on https://YOUR_FQDN. On the first page you’ve provided with initial login details.

mayan edms docker 01

Use the Username and Password provided to login.

mayan edms docker 02

To change admin user password, go to User > admin > Change Password on the right top corner.

mayan edms docker 03

Provide default password and set new Password for the user.

mayan edms docker 04

You now have Mayan EDMS successfully installed on Docker Container. Visit Mayan Documentation pages to learn more about how to configure and start using it in your environment.

Similar articles:

LEAVE A REPLY

Please enter your comment!
Please enter your name here