Simple Docker installation

Warning

Starting with version 3.4, the preferred method of installation when using Docker is with Docker Compose.

  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:s4
    

    Note

    Do not use the latest tag. It may not necessarily point to the latest version, might be pointing to the latest image pushed.

  3. Download the PostgreSQL Docker image:

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

    docker pull redis:7.0.10-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:13.10-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:7.0.10-alpine \
    redis-server \
    --databases \
    "3" \
    --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_CELERY_BROKER_URL="redis://:mayanredispassword@172.17.0.1:6379/0" \
    -e MAYAN_CELERY_RESULT_BACKEND="redis://:mayanredispassword@172.17.0.1:6379/1" \
    -e MAYAN_DATABASES="{'default':{'ENGINE':'django.db.backends.postgresql','NAME':'mayan','PASSWORD':'mayanuserpass','USER':'mayan','HOST':'172.17.0.1'}}" \
    -e MAYAN_LOCK_MANAGER_BACKEND="mayan.apps.lock_manager.backends.redis_lock.RedisLock" \
    -e MAYAN_LOCK_MANAGER_BACKEND_ARGUMENTS="{'redis_url':'redis://:mayanredispassword@172.17.0.1:6379/2'}" \
    -v /docker-volumes/mayan-edms/media:/var/lib/mayan \
    mayanedms/mayanedms:s4
    

    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.