Docker-compose
To provide stability and scalability, we recommend using container orchestration in production.
Check the examples to learn how to run the Collaboration Server On-Premises in production.
A valid license key is needed in order to install Collaboration Server On-Premises.
Contact us for a trial license key.
For evaluation and testing purposes, you can follow the Quick-start guide, where we provide an easy-to-use script for setting up all necessary infrastructure for Collaboration Server On-Premises on your local machine.
Follow the steps below to install the CKEditor Collaboration Server On-Premises using the Docker container.
- Use the instructions from the Customer Portal to log into the Collaboration Server On-PremisesDocker Registry and pull the Docker image.
- Containerize the application using dockerordocker-compose.
- Create the Environmentwith anAccess Keyvia the Cloud Services Management Panel. Use this data to create the token endpoint and run tests.
- Run tests to verify if the system works properly – see the Running tests using Docker guide.
- Configure the server endpoints in the CKEditor Collaboration web application to communicate with the Collaboration Server On-Premises application – see the Setting endpoints guide.
Use the steps below to containerize the application using docker-compose.
Please bear in mind that docker-compose is useful for development purposes. This, however, does not fulfill our architecture recommendations for production environments. This is why we created the example scripts and added information about the recommended infrastructure for AWS.
- Create the docker-compose.ymlfile:version: "2.2" services: mysql-database: image: mysql:8.0.34 platform: linux/amd64 environment: MYSQL_ROOT_PASSWORD: password volumes: - ./init.sql:/docker-entrypoint-initdb.d/init.sql:ro healthcheck: # Define healthcheck to be able to use the `service_healthy` condition. test: ["CMD-SHELL", "exit | mysql -h localhost -P 3306 -u root -p$MYSQL_ROOT_PASSWORD" ] interval: 10s timeout: 30s retries: 5 redis: image: redis:6.2.7 ckeditor-cs: image: docker.cke-cs.com/cs:[version] depends_on: redis: condition: service_started mysql-database: condition: service_healthy # Make sure your database is ready for migration. ports: - "8000:8000" restart: always init: true environment: DATABASE_HOST: mysql-database DATABASE_USER: root DATABASE_PASSWORD: password REDIS_HOST: redis ENVIRONMENTS_MANAGEMENT_SECRET_KEY: secret LICENSE_KEY: your_license_keyCopy code
- Create the init.sqlfile:CREATE DATABASE `cs-on-premises` DEFAULT CHARACTER SET utf8mb4 DEFAULT COLLATE utf8mb4_bin;Copy code
- Run:docker-compose upCopy code
- Create the docker-compose.ymlfile:version: "2.2" services: postgres-database: image: postgres:12.12 environment: - POSTGRES_PASSWORD=password volumes: - ./init.sql:/docker-entrypoint-initdb.d/init.sql:ro healthcheck: # Define healthcheck to be able to use the `service_healthy` condition. test: pg_isready -U postgres interval: 10s timeout: 30s retries: 5 redis: image: redis:6.2.7 ckeditor-cs-postgres: image: docker.cke-cs.com/cs:[version] depends_on: redis: condition: service_started postgres-database: condition: service_healthy # Make sure your database is ready for migration. ports: - "8000:8000" restart: always init: true environment: DATABASE_DRIVER: postgres DATABASE_HOST: postgres-database DATABASE_PORT: 5432 DATABASE_USER: postgres DATABASE_PASSWORD: password DATABASE_DATABASE: cksource DATABASE_SCHEMA: cke-cs REDIS_HOST: redis ENVIRONMENTS_MANAGEMENT_SECRET_KEY: secret LICENSE_KEY: your_license_keyCopy code
- Create the init.sqlfile:CREATE DATABASE "cksource"; \connect "cksource"; CREATE SCHEMA "cke-cs";Copy code
- Run:docker-compose upCopy code
The steps are similar to in the case of regular CKEditor Collaboration Server On-Premises installation.
We use docker-compose as an example configuration to explain how the services should be configured. In a production environment, we recommend using clusters managed by a container-orchestration system like Docker Swarm, Kubernetes, ECS, GKE, AKS, or OpenShift.
- If you have the docker-compose.ymlfile already, you can only add theworker-csservice and set theUSE_BUILT_IN_COLLABORATION_WORKERenvironment variable tofalseinckeditor-cs. Otherwise, create the file with the following content:
version: "3.7"
services:
  mysql-database:
    image: mysql:8.0.34
    platform: linux/amd64
    environment:
      MYSQL_ROOT_PASSWORD: password
    volumes:
      - ./init.sql:/docker-entrypoint-initdb.d/init.sql:ro
    healthcheck: # Define healthcheck to be able to use the `service_healthy` condition.
      test: ["CMD-SHELL", "exit | mysql -h localhost -P 3306 -u root -p$MYSQL_ROOT_PASSWORD" ]
      interval: 10s
      timeout: 30s
      retries: 5
  redis:
    image: redis:6.2.7
  ckeditor-cs:
    image: docker.cke-cs.com/cs:[version]
    depends_on:
      redis:
        condition: service_started
      mysql-database:
        condition: service_healthy # Make sure your database is ready for migration.
    ports:
      - "8000:8000"
    restart: always
    init: true
    environment:
      DATABASE_DRIVER: mysql
      DATABASE_HOST: mysql-database
      DATABASE_USER: root
      DATABASE_PASSWORD: password
      REDIS_HOST: redis
      ENVIRONMENTS_MANAGEMENT_SECRET_KEY: secret
      LICENSE_KEY: your_license_key
      USE_BUILT_IN_COLLABORATION_WORKER: "false"
  worker-cs:
    image: docker.cke-cs.com/cs-worker:[version]
    depends_on:
      redis:
        condition: service_started
      mysql-database:
        condition: service_healthy # Make sure your database is ready for migration.
    restart: always
    init: true
    environment:
      DATABASE_DRIVER: mysql
      DATABASE_HOST: mysql-database
      DATABASE_USER: root
      DATABASE_PASSWORD: password
      REDIS_HOST: redis
The version of cs and cs-worker images should be the same.
You should also connect the services to the same Redis and SQL databases.
- 
Create the init.sqlfile:CREATE DATABASE `cs-on-premises` DEFAULT CHARACTER SET utf8mb4 DEFAULT COLLATE utf8mb4_bin;Copy code
- 
Run: docker-compose upCopy code
- Use environment variables to configure the application. See the environmental variables guide.
- You should override the ENVIRONMENTS_MANAGEMENT_SECRET_KEYvariable using a unique and hard to guess string due to security reasons.
- The application will not start without a correct LICENSE_KEY
- If you use collaboration features (like document storage, import and export, or connection optimizer) intensively, we recommend using Collaboration Worker to improve reliability.
Launch the Docker container:
docker run --init -p 8000:8000 -e DATABASE_HOST=[your_mysql_host] -e DATABASE_USER=[your_mysql_user] -e DATABASE_PASSWORD=[your_mysql_password] -e REDIS_HOST=[your_redis_host] -e LICENSE_KEY=[your_license_key] docker.cke-cs.com/cs:[version]
Notes:
- Use environment variables to configure the application. See the configuration guide. Examples:
- If an SQL database and Redis are hosted on 192.168.118.27, you should pass the address through theDATABASE_HOSTandREDIS_HOSTvariables:docker run --init -p 8000:8000 -e DATABASE_HOST=192.168.118.27 -e REDIS_HOST=192.168.118.27 -e DATABASE_USER=root -e DATABASE_PASSWORD=root_password -e LICENSE_KEY=[your_license_key] docker.cke-cs.com/cs:[version]Copy code
- If you want to change the port on which the application will be served to 5000, override theAPPLICATION_HTTP_PORTvariable and change exposed ports:docker run --init -p 5000:5000 -e APPLICATION_HTTP_PORT=5000 -e DATABASE_HOST=192.168.118.27 -e REDIS_HOST=192.168.118.27 -e DATABASE_USER=root -e DATABASE_PASSWORD=root_password -e LICENSE_KEY=[your_license_key] docker.cke-cs.com/cs:[version]Copy code
 
- If an SQL database and Redis are hosted on 
- You should override the ENVIRONMENTS_MANAGEMENT_SECRET_KEYvariable using a unique and hard to guess string due to security reasons.
- The application will not start without a correct LICENSE_KEY.