Project: DolphinScheduler (Orchestration & Management / Scheduling & Orchestration)
File: docker.md

There are three ways to start DolphinScheduler with Docker is the way you find if you just want to start and try DolphinScheduler as a beginner. is for some who want to deploy DolphinScheduler in small or event middle scale workflows in their daily work. is for users who want to reuse the database or zookeeper server already exists. Need to install 1.13.1+ and 1.28.0+ before starting DolphinScheduler with Docker Start DolphinScheduler with standalone-server Docker images is the easiest way to experience and explode it. In this way, you can learn DolphinScheduler's concepts and usage, with minimal cost. ```shell $ DOLPHINSCHEDULER_VERSION=<version> $ docker run --name dolphinscheduler-standalone-server -p 12345:12345 -p 25333:25333 -d apache/dolphinscheduler-standalone-server:"${DOLPHINSCHEDULER_VERSION}" ``` Note: Do not use apache/dolphinscheduler-standalone-server Docker image in production, it should only for you to taste DolphinScheduler at the first time. Not only because it runs all services in one single process, but also it uses H2 as its database which will lose metadata after it stops (could be changed to another database to avoid it). In addition, apache/dolphinscheduler-standalone-server only contains DolphinScheduler core services, some tasks such as Spark and Flink, require external components or environment to run it. The difference between start services by docker-compose and standalone-server are servers running in one single process or not. Services start with docker-compose running in separate containers, as well as different processes. Metadata could be stored on disks after you change docker-compose configuration, and it is robust and stable for someone who wants to run DolphinScheduler in a long term. You have to install before you start servers. After complete the installation, get the `docker-compose.yaml` file from form its source package, and make sure you get the right version. After download the package, you can run the commands as below. ```shell $ DOLPHINSCHEDULER_VERSION=<version> $ tar -zxf apache-dolphinscheduler-"${DOLPHINSCHEDULER_VERSION}"-src.tar.gz $ cd apache-dolphinscheduler-"${DOLPHINSCHEDULER_VERSION}"-src/deploy/docker $ docker-compose --profile schema up -d $ docker-compose --profile all up -d ``` NOTES: After installed docker-compose, it is recommended to modify some configurations for better

We highly recommended modify docker daemon memory up to 4 GB, see for more detail. It will not only start DolphinScheduler servers but also some others necessary services like PostgreSQL(with `root` as user, `root` as password and `dolphinscheduler` as database) and ZooKeeper when starting with docker-compose. will create new a database and the ZooKeeper container when it up. You could start DolphinScheduler server separately if you want to reuse your exists services. ```shell $ DOLPHINSCHEDULER_VERSION=<version> $ docker run -d --name dolphinscheduler-tools \ -e DATABASE="postgresql" \ -e SPRINGDATASOURCEURL="jdbc:postgresql://localhost:5432/<DATABASE>" \ -e SPRINGDATASOURCEUSERNAME="<USER>" \ -e SPRINGDATASOURCEPASSWORD="<PASSWORD>" \ -e SPRINGJACKSONTIME_ZONE="UTC" \ --net host \ apache/dolphinscheduler-tools:"${DOLPHINSCHEDULER_VERSION}" tools/bin/upgrade-schema.sh $ docker run -d --name dolphinscheduler-master \ -e DATABASE="postgresql" \ -e SPRINGDATASOURCEURL="jdbc:postgresql://localhost:5432/<DATABASE>" \ -e SPRINGDATASOURCEUSERNAME="<USER>" \ -e SPRINGDATASOURCEPASSWORD="<PASSWORD>" \ -e SPRINGJACKSONTIME_ZONE="UTC" \ -e REGISTRYZOOKEEPERCONNECT_STRING="localhost:2181" \ --net host \ -d apache/dolphinscheduler-master:"${DOLPHINSCHEDULER_VERSION}" $ docker run -d --name dolphinscheduler-worker \ -e DATABASE="postgresql" \ -e SPRINGDATASOURCEURL="jdbc:postgresql://localhost:5432/<DATABASE>" \ -e SPRINGDATASOURCEUSERNAME="<USER>" \ -e SPRINGDATASOURCEPASSWORD="<PASSWORD>" \ -e SPRINGJACKSONTIME_ZONE="UTC" \ -e REGISTRYZOOKEEPERCONNECT_STRING="localhost:2181" \ --net host \ -d apache/dolphinscheduler-worker:"${DOLPHINSCHEDULER_VERSION}" $ docker run -d --name dolphinscheduler-api \ -e DATABASE="postgresql" \ -e SPRINGDATASOURCEURL="jdbc:postgresql://localhost:5432/<DATABASE>" \ -e SPRINGDATASOURCEUSERNAME="<USER>" \ -e SPRINGDATASOURCEPASSWORD="<PASSWORD>" \ -e SPRINGJACKSONTIME_ZONE="UTC" \ -e REGISTRYZOOKEEPERCONNECT_STRING="localhost:2181" \ --net host \ -d apache/dolphinscheduler-api:"${DOLPHINSCHEDULER_VERSION}" $ docker run -d --name dolphinscheduler-alert-server \ -e DATABASE="postgresql" \ -e SPRINGDATASOURCEURL="jdbc:postgresql://localhost:5432/<DATABASE>" \ -e SPRINGDATASOURCEUSERNAME="<USER>" \ -e SPRINGDATASOURCEPASSWORD="<PASSWORD>" \ -e SPRINGJACKSONTIME_ZONE="UTC" \ -e REGISTRYZOOKEEPERCONNECT_STRING="localhost:2181" \ --net host \ -d apache/dolphinscheduler-alert-server:"${DOLPHINSCHEDULER_VERSION}" ``` Note: You should install and start (8.2.15+) and (3.8.0) by yourself if you want to use this way to start Dolphinscheduler, but you do not have those services You could access DolphinScheduler web UI by click and use `admin` and `dolphinscheduler123` as default username and password in the login page. Note: If you start the services by the way , and starting with multiple machine, you should change URL domain from `localhost` to IP or hostname the api server running. You can modify some environment variables to change configurations when you are starting servers through Docker. We have an example in to change database and ZooKeeper configurations, and you could find all environment variables in <!-- markdown-link-check-disable-line --> and change them if you want.