Skip to main content

๐Ÿ›  Source Code Deployment

1. Environment and Component Requirementsโ€‹

For server environment, system, and storage components, refer to this document.

2. Deploying OpenIM Server (IM)โ€‹

2.1 ๐Ÿ“ก Setting OPENIM_IPโ€‹

๐Ÿ”” It is mandatory to set OPENIM_IP, and it cannot be

# If the server has a public IP
export OPENIM_IP="Public IP"

# If only providing internal network service
export OPENIM_IP="Internal IP"

2.2 ๐Ÿ—๏ธ Deploying Components (mongodb/redis/zookeeper/kafka/MinIO, etc.)โ€‹

git clone && cd open-im-server
# It's recommended to switch to the release-v3.5 or later release branches
make init && docker compose up -d

2.3 ๐Ÿ› ๏ธ Compilingโ€‹

make build

2.4 ๐Ÿš€ Starting/Stopping/Checkingโ€‹

# Start
make start
# Stop
make stop
# Check
make check

3. Deploying App Server (Chat)โ€‹

3.1 ๐Ÿ—๏ธ Clone chat repositoryโ€‹

# Return to the previous directory
cd ..
# Clone the repository. It's recommended to switch to the release-v1.5 or later release branches
git clone chat && cd chat

3.2 ๐Ÿ› ๏ธ Compilingโ€‹

make init
make build

3.3 ๐Ÿš€ Starting/Stopping/Checkingโ€‹

# Start
make start
# Stop
make stop
# Check
make check

4. Quick Verificationโ€‹

Please refer to the Quick Verification document.

5. Admin Panel and Monitoring Systemโ€‹

Please refer to the Admin Panel and Monitoring System document.

6. About Modifying Configuration Itemsโ€‹

6.1 ๐Ÿ› ๏ธ Modifying Shared Configuration Itemsโ€‹

Configuration ItemFiles to ModifyOperation
mongo/kafka/minio related.env, openim-server/config/config.yamlNeed to restart components and IM
redis/zookeeper related.env, openim-server/config/config.yaml, chat/config/config.yamlNeed to restart components, IM, and Chat
SECRETopenim-server/config/config.yaml, chat/config/config.yamlNeed to restart IM and Chat

6.2 ๐Ÿ”„ Modifying Special Shared Configuration Itemsโ€‹


  1. Modify the special configuration items in the .env file.
  2. Modify configurations in openim-server/config/config.yaml as per rules:
signEndpoint: "http://$OPENIM_IP:$MINIO_PORT"

grafanaUrl: http://$OPENIM_IP:$GRAFANA_PORT
  1. Modify configurations in chat/config/config.yaml as per rules:
If IM and Chat are not on the same machine, you need to replace with the IP address of the machine where IM is located
  1. Restart IM and Chat

6.3 ๐Ÿ› ๏ธ Modifying Other Configuration Itemsโ€‹

For other configuration items in .env, chat/config/config.yaml, and openim-server/config/config.yaml, these can be modified individually in the respective files.

6.4 Modifying Portsโ€‹

Especially note that any modification of IM-related ports needs to be synchronized with the ports in open-im-server/scripts/install/

7. Common Issuesโ€‹

7.1 ๐Ÿ“œ Viewing Logsโ€‹

Log Locations:

  • Runtime logs, for troubleshooting after successful startup: _output/logs/openim-all*
  • Startup logs, for checking in case of errors during startup: _output/logs/openim-*.log

7.2 ๐Ÿš€ Startup Sequenceโ€‹

The startup sequence is as follows:

  • Components IM depends on: mongo/redis/kafka/zookeeper/minio, etc.
  • IM
  • Chat

7.3 ๐Ÿณโ€‹

Docker Version

The newer version of Docker has integrated docker-compose. Older versions of Docker may not support the gateway featureโŒ. We recommend upgrading to a newer version, such as 23.0.1๐Ÿ”.