Simple Docker installation¶
Warning
Starting with version 3.4, the preferred method of installation when using Docker is with Docker Compose.
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.
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.Download the PostgreSQL Docker image:
docker pull postgres:13.10-alpine
Download the Redis Docker image:
docker pull redis:7.0.10-alpine
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 namedmayan
too, with a password ofmayanuserpass
. 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.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.
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 thedjango.db.backends.postgresql
database driver and connect to themayan
database using themayan
user with the passwordmayanuserpass
. 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
.