Simple Docker installation

  1. Install Docker:

    wget -qO- https://get.docker.com/ | sh
    

    If you don’t want to run an automated script, follow the instructions outlined in their documentation: https://docs.docker.com/install/

    Once the Docker installation is finished, proceed to the link below to install the Docker image for Mayan EDMS.

  2. Download the Mayan EDMS Docker image:

    With Docker properly installed, proceed to download the Mayan EDMS Docker image using the command:

    docker pull mayanedms/mayanedms:3.4.12
    
  3. Download the PostgreSQL Docker image:

    docker pull postgres:9.6-alpine
    
  4. Download the Redis Docker image:

    docker pull redis:5.0-alpine
    
  5. Create and run a PostgreSQL container:

    docker run \
    -d \
    --name mayan-edms-postgres \
    --restart=always \
    -p 5432:5432 \
    -e POSTGRES_USER=mayan \
    -e POSTGRES_DB=mayan \
    -e POSTGRES_PASSWORD=mayanuserpass \
    -v /docker-volumes/mayan-edms/postgres:/var/lib/postgresql/data \
    postgres:9.6-alpine
    

    The PostgreSQL container will have one database named mayan, with an user named mayan too, with a password of mayanuserpass. The container will expose its internal 5432 port (PostgreSQL’s default port) via the host’s 5432 port. The data of this container will reside on the host’s /docker-volumes/mayan-edms/postgres folder.

  6. Create and run a Redis container:

    docker run \
    -d \
    --name mayan-edms-redis \
    --restart=always \
    -p 6379:6379 \
    -v /docker-volumes/mayan-edms/redis:/data \
    redis:5.0-alpine \
    redis-server \
    --databases \
    "2" \
    --maxmemory-policy \
    allkeys-lru \
    --save \
    "" \
    --requirepass mayanredispassword
    

    The Redis container will have two databases, one for background task messages, and the other to hold the results of those background tasks. Redis is configure to not save its content to disk and to automatically clear up memory.

  7. Create and run a Mayan EDMS container:

    docker run \
    -d \
    --name mayan-edms \
    --restart=always \
    -p 80:8000 \
    -e MAYAN_DATABASES="{'default':{'ENGINE':'django.db.backends.postgresql','NAME':'mayan','PASSWORD':'mayanuserpass','USER':'mayan','HOST':'172.17.0.1'}}" \
    -e MAYAN_CELERY_BROKER_URL="redis://:mayanredispassword@172.17.0.1:6379/0" \
    -e MAYAN_CELERY_RESULT_BACKEND="redis://:mayanredispassword@172.17.0.1:6379/1" \
    -v /docker-volumes/mayan-edms/media:/var/lib/mayan \
    mayanedms/mayanedms:3.4.12
    

    The Mayan EDMS container will connect to the PostgreSQL container via the 172.17.0.1 IP address (the Docker host’s default IP address). It will connect using the django.db.backends.postgresql database driver and connect to the mayan database using the mayan user with the password mayanuserpass. The files of the container will be store in the host’s /docker-volumes/mayan-edms/media folder. The container will expose its web service running on port 8000 on the host’s port 80.

    The container will be available by browsing to http://localhost or to the IP address of the computer running the container.

    If another web server is running on port 80 use a different port in the -p option. For example: -p 81:8000.