# OpenIM (Open-Source Instant Messaging) Mac Deployment Guide

This guide provides step-by-step instructions for deploying OpenIM on a Mac, including both source code and Docker deployment methods.

Preliminary Environment Setup

Ensure a clean working environment:

  1. Create a New Directory: Start in a new directory to prevent conflicts.
  2. Check for Conflicting Processes : Run these commands:
    • ps -ef | grep openim
    • ps -ef | grep chat
  3. Check Docker Containers : Use docker ps to confirm no related containers are running.

Source Code Deployment

Deploying openim-server

Deploying from source requires adjusting Docker's network configurations for Mac.

  1. Clone and Prepare the Repository:

    jsx 复制代码
    git clone https://github.com/openimsdk/open-im-server
    cd open-im-server
    export OPENIM_IP="[Your External/Internal IP]"
    make init
  2. Configure Kafka in docker-compose.yml:

    • Replace:

      jsx 复制代码
      - KAFKA_CFG_ADVERTISED_LISTENERS=PLAINTEXT://kafka:9092,EXTERNAL://${DOCKER_BRIDGE_GATEWAY:-172.28.0.1}:${KAFKA_PORT:-19094}
    • With:

      jsx 复制代码
      - KAFKA_CFG_ADVERTISED_LISTENERS=PLAINTEXT://kafka:9092,EXTERNAL://127.0.0.1:${KAFKA_PORT:-19094}
  3. Start the Service:

    jsx 复制代码
    docker compose up -d
  4. Final Configurations:

    jsx 复制代码
    vim config/config.yaml -c "%s/172\.28\.0\.1/127.0.0.1/g" -c "wq"
  5. Launch openim-server:

    jsx 复制代码
    make start
  6. Verification:

    jsx 复制代码
    make check

    Wait five minutes before checking to ensure accuracy.

Deploying openim-chat

Deploy openim-chat using source code or Docker.

  1. Return to Parent Directory:

    jsx 复制代码
    cd ..
  2. Deploy from Source:

    jsx 复制代码
    git clone https://github.com/openimsdk/chat
    cd chat
    make init
  3. Set Up MySQL (if not already deployed):

    jsx 复制代码
    docker run -d \
      --name mysql \
      -p 13306:3306 \
      -p 23306:33060 \
      -v "$(pwd)/components/mysql/data:/var/lib/mysql" \
      -v "/etc/localtime:/etc/localtime" \
      -e MYSQL_ROOT_PASSWORD="openIM123" \
      --restart always \
      mariadb:10.6
  4. Configure openim-chat :

    Modify config/config.yaml, replacing 172.28.0.1 with 127.0.0.1.

  5. Start openim-chat:

    jsx 复制代码
    make start
  6. Verification:

    jsx 复制代码
    make check
  7. Web Interface Access :

    Visit http://127.0.0.1:11001. For validation, see this guide.

Docker Deployment

For Docker deployment on Mac, refer to OpenIM Docker Documentation.

About OpenIM

OpenIM is an open-source instant messaging component and solution that specializes in in-app communication. It is one of the most popular open-source IM projects currently. Developers can integrate the OpenIM component and deploy the server privately, quickly incorporating instant and real-time communication capabilities into their applications, ensuring the security and confidentiality of business data.

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

Developer Documentation: https://docs.openim.io/guides/introduction

相关推荐
00后程序员张1 分钟前
iOS 26 内存占用监控 多工具协同下的性能稳定性分析实战
android·macos·ios·小程序·uni-app·cocoa·iphone
sunshine~~~27 分钟前
【笔记】macOs arm架构安装虚拟机Ubuntu环境:ROS2 + Python开发
arm开发·笔记·python·macos·ros2
心灵宝贝31 分钟前
Mac版Color Folder v3.8安装教程(附dmg文件安装步骤和搜索关键词)
macos
北冥有鱼被烹39 分钟前
【微知】MAC笔记本如何重启tourchbar?(sudo pkill TouchBarServer)
macos
2501_915909062 小时前
iOS 26 性能监控工具有哪些?多工具协同打造全方位性能分析体系
android·macos·ios·小程序·uni-app·cocoa·iphone
行思理2 小时前
macos 如何清空IntelliJ IDEA安装记录
java·macos·intellij-idea
憨憨崽&3 小时前
Mac如何安装mysql和完全卸载mysql
macos
stayhungry_c3 小时前
Quarto生成PDF无法正常显示中文的问题
python·macos·r语言·pdf
2501_915918413 小时前
uni-app 上架 iOS 应用全流程 从云打包到开心上架(Appuploader)免 Mac 上传发布指南
android·macos·ios·小程序·uni-app·iphone·webview
木易 士心5 小时前
在 Mac 上配置 ADB 环境变量:解决 “command not found: adb” 问题
macos·adb