Docker Deployment
1. Environment Preparation đâ
For server hardware, software, operating system, and dependent components, please refer to this document.
2. Deploy OpenIMServerâ
2.1 Clone the Repository đī¸â
Use the latest official release tag marked with the green Latest badge on the GitHub Releases page. Do not sort tags manually, and do not use pre-release versions such as alpha or rc.
git clone https://github.com/openimsdk/openim-docker && cd openim-docker
git fetch --tags
LATEST_STABLE_TAG=$(basename "$(curl -fsSLI -o /dev/null -w '%{url_effective}' https://github.com/openimsdk/openim-docker/releases/latest)")
git checkout "$LATEST_STABLE_TAG"
echo "using openim-docker stable release tag: $LATEST_STABLE_TAG"
Here,
latestmeans the latest official release marked with the green Latest badge on GitHub Releases. It does not include alpha, beta, rc, or other pre-releases.mainis the development branch and should not be used directly in production.
2.2 Configuration Changes đ§â
-
Edit
.envand configure the MinIO external IP to support image and file sending. Replaceyour-server-ipwith your server's public IP.MINIO_EXTERNAL_ADDRESS="http://your-server-ip:10005"
2.3 Start Services đâ
- Start services:
docker compose up -d
The first run pulls large images and may take some time. After startup, wait
30-60sbefore running health checks or API verification.
This document assumes a clean environment. If the machine already has containers with the same names such as
mongo,redis,kafka,etcd,minio,openim-server, oropenim-chat,docker compose up -dwill fail because ofcontainer_nameconflicts. In that case, stop and remove those containers first, or reuse the existing components after adjusting configuration.
If startup shows warnings such as missing
ETCD_USERNAME,ETCD_PASSWORD,KAFKA_USERNAME, orKAFKA_PASSWORD, and you have not enabled authentication for those components, these warnings can usually be ignored.
- Stop services:
docker compose down
- View logs:
docker compose logs -f openim-server openim-chat
2.4 Monitoring & Alerting (Optional)â
If you also want to start Prometheus, Alertmanager, Grafana, and node-exporter, run:
docker compose --profile m up -d
Here, m is the monitoring profile defined by openim-docker in docker-compose.yaml. Enabling it starts these extra services:
Prometheus: metrics collectionAlertmanager: alert routingGrafana: monitoring dashboardsnode-exporter: host metrics collection
Default ports follow the current .env. Common values are:
19090: Prometheus19093: Alertmanager13000: Grafana19100: node-exporter
For production environments, it is recommended to enable monitoring and alerting, which means starting the
mprofile withdocker compose --profile m up -d.openim-dockeralready includes Prometheus scrape configuration, Alertmanager configuration, and basic alert rules for cases such as instance failures, database exceptions, low registrations, and low message volume.
To actually receive alert notifications, complete the
Alertmanagernotification configuration for your environment, such as SMTP settings.
3. Quick Experience âĄâ
To quickly experience core OpenIMSDK capabilities and verify whether OpenIMServer / ChatServer deployment is working, refer to Quick Verification.
4. FAQâ
Troubleshooting unhealthyâ
- Run
docker exec -it openim-server mage checkanddocker exec -it openim-chat mage check, then confirm whether either state lasts longer than one minute. - Run
docker compose logs -f openim-server openim-chatto inspect logs. - If
openim-chatbriefly reportsconnect: connection refusedduring startup, wait30-60sand check again. This is usually a startup ordering issue whileopenim-serveris still becoming ready.
Configuration Changesâ
Editing files under the container config directory does not work.
Configuration changes must be made through environment variables. See the environment variable guide.