Open Source Instant Messaging (IM) Project OpenIM Source Code

本文涉及的产品
对象存储 OSS,20GB 3个月
对象存储 OSS,恶意文件检测 1000次 1年
对象存储 OSS,内容安全 1000次 1年
简介: Open Source Instant Messaging (IM) Project OpenIM Source Code

Deploying OpenIM involves multiple components and supports various methods, including source code, Docker, and Kubernetes. This requires ensuring compatibility between different deployment methods while effectively managing differences between versions. Indeed, these are complex issues involving in-depth technical details and precise system configurations. Our goal is to simplify the deployment process while maintaining the system’s flexibility and stability to suit different users’ needs. Currently, version 3.5 has simplified the deployment process, and this version will be maintained for a long time. We welcome everyone to use it.

  1. Environment and Component Requirements

🌐 Environmental Requirements

NoteDetailed Description

OSLinux system

HardwareAt least 4GB of RAM

Golangv1.19 or higher

Dockerv24.0.5 or higher

Gitv2.17.1 or higher

Storage Component Requirements

Storage ComponentRecommended Version

MongoDBv6.0.2 or higher

Redisv7.0.0 or higher

Zookeeperv3.8

Kafkav3.5.1

MySQLv5.7 or higher

MinIOLatest version

  1. Deploying OpenIM Server (IM)

2.1 Setting OPENIM_IP

If the server has an external IPexportOPENIM_IP="external IP"# If only providing internal network servicesexportOPENIM_IP="internal IP"

2.2 🏗️ Deploying Components (mongodb/redis/zookeeper/kafka/MinIO, etc.)

gitclone https://github.com/OpenIMSDK/open-im-server&&cdopen-im-server# It's recommended to switch to release-v3.5 or later release branchesmakeinit&&docker compose up -d

2.3 🛠️ Compilation

makebuild

2.4 Starting/Stopping/Checking

Startmakestart# Stopmakestop# Checkmakecheck

  1. Deploying App Server (Chat)

3.1 🏗️ Deploying Components (mysql)

Go back to the previous directorycd..# Clone the repository, recommended to switch to release-v1.5 or later release branchesgitclone https://github.com/OpenIMSDK/chat chat&&cdchat# Deploy mysqldocker run -d --name mysql2 -p13306:3306 -p33306:33060 -v"$(pwd)/components/mysql/data:/var/lib/mysql"-v"/etc/localtime:/etc/localtime"-eMYSQL_ROOT_PASSWORD="openIM123"--restart always mysql:5.7

3.2 🛠️ Compilation

makeinitmakebuild

3.3 Starting/Stopping/Checking

Startmakestart# Stopmakestop# Checkmakecheck

  1. Quick Validation

Open Ports

IM Ports

TCP PortDescriptionAction

TCP:10001ws protocol, messaging port, for client SDKAllow port

TCP:10002API port, like user, friend, group, message interfacesAllow port

TCP:10005Required when choosing MinIO storage (OpenIM defaults to MinIO storage)Allow port

Chat Ports

TCP PortDescriptionAction

TCP:10008Business system, like registration, login, etc.Allow port

TCP:10009Management backend, like statistics, account banning, etc.Allow port

PC Web and Management Backend Frontend Resource Ports

TCP PortDescriptionAction

TCP:11001PC Web frontend resourcesAllow port

TCP:11002Management backend frontend resourcesAllow port

Grafana Port

TCP PortDescriptionAction

TCP:13000Grafana portAllow port

Verification

PC Web Verification

Note: Enter http://ip:11001 in your browser to access the PC Web. This IP should be the server’s OPENIM_IP to ensure browser accessibility. For first-time use, please register using your mobile phone number, with the default verification code being 666666.
webwxgetmsgimg.jpg

Image: PC Web Interface Example

App Verification

Scan the following QR code or click here to download.

Image: App Download QR Code

Note: Double-click on OpenIM and change the IP to the server’s OPENIM_IP then restart the App. Please ensure related ports are open, and restart the App after making changes. For first-time use, please register first through your mobile phone number, with the default verification code being 666666.
2.jpg

Image: Server Address Modification - Step 1
3.jpg

Image: Server Address Modification - Step 2

  1. Modifying Configuration Items

5.1 🛠️ Modifying Shared Configuration Items

Configuration ItemFiles to be ModifiedAction

mongo/kafka/minio related.env, openim-server/config/config.yamlRestart components and IM

redis/zookeeper related.env, openim-server/config/config.yaml, chat/config/config.yamlRestart components, IM, and Chat

SECRETopenim-server/config/config.yaml, chat/config/config.yamlRestart IM and Chat

5.2 🔄 Modifying Special Configuration Items

Special configuration items: API_OPENIM_PORT/MINIO_PORT/OPENIM_IP/GRAFANA_PORT

Modify the special configuration items in the .env file

Modify the configuration in openim-server/config/config.yaml according to the rules

Modify the configuration in chat/config/config.yaml according to the rules

Restart IM and Chat

5.3 🛠️ Modifying Other Configuration Items

For other configuration items in .env, chat/config/config.yaml, and openim-server/config/config.yaml, you can modify these items directly in the respective files.

5.4 Modifying Ports

Note that for any modification of IM-related ports, it’s necessary to synchronize the changes in open-im-server/scripts/install/environment.sh.

  1. Frequently Asked Questions

6.1 📜 Viewing Logs

Runtime logs: logs/OpenIM.log.all.*

Startup logs: output/logs/openim*.log

6.2 Startup Order

The startup order is as follows:

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

IM

Components Chat depends on: mysql

Cha

t

6.3 Docker Version

The new version of Docker has integrated docker-compose.

Older versions of Docker might not support the gateway feature. It’s recommended to upgrade to a newer version, such as 23.0.1.

  1. About OpenIM

Thanks to widespread developer support, OpenIM maintains a leading position in the open-source instant messaging (IM) field, with the number of stars on Github exceeding 12,000. In the current context of increasing attention to data and privacy security, the demand for IM private deployment is growing, which aligns with the rapid development trend of China’s software industry. Especially in government and enterprise sectors, with the rapid development of information technology and the widespread application of innovative

industries, the demand for IM solutions has surged. Further, the continuous expansion of the collaborative office software market has made “secure and controllable” a key attribute.

Repository address: https://github.com/openimsdk
4.jpg

目录
相关文章
|
3月前
|
消息中间件 安全 关系型数据库
OpenIM (Open-Source Instant Messaging) Mac Deployment Guide
OpenIM (Open-Source Instant Messaging) Mac Deployment Guide
70 0
|
Go 开发工具
【Go】The selected directory is not a valid home for Go SDK
【Go】The selected directory is not a valid home for Go SDK
351 0
【Go】The selected directory is not a valid home for Go SDK
|
JavaScript 前端开发 物联网
12 Open Source Projects by Alibaba – Part 2
This article introduces and summarizes twelve open source projects from Alibaba and Alibaba Cloud.
2231 0
12 Open Source Projects by Alibaba – Part 2
|
NoSQL Dubbo 应用服务中间件
12 Open Source Projects by Alibaba – Part 1
This article introduces and summarizes twelve open source projects from Alibaba and Alibaba Cloud.
4543 0
12 Open Source Projects by Alibaba – Part 1
SAP QM Source Inspection Demo
SAP QM Source Inspection Demo   可以设置为外检不合格,则不让业务执行GR ,如下图: 它与Q-Info中如下设置是有关系的,如下图: 能达到的效果是:我们靠外检的检验批的结果来控制是否收货。
1443 0
|
安全
11 open source security tools catching fire on GitHub
http://www.infoworld.com/article/2606779/security/163151-11-open-source-security-tools-catching-fire-on-GitHub.
697 0