# 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

相关推荐
一牛1 小时前
Appkit: 菜单是如何工作的
macos·ios·objective-c
tkevinjd2 小时前
文件操作、流对象示例
macos·objective-c·cocoa
Dachui_11221 天前
MacOS上如何运行内网穿透详细教程
macos
Bruce_Liuxiaowei1 天前
使用Python脚本在Mac上彻底清除Chrome浏览历史:开发实战与隐私保护指南
chrome·python·macos
iFlyCai1 天前
对Mac文字双击或三击鼠标左键没有任何反应
macos·计算机外设
請你喝杯Java2 天前
Mac上Cursor无法安装插件解决方法
macos·cursor·vsode
网络之路Blog2 天前
【实战中提升自己】内网安全部署之端口隔离与MAC地址认证
安全·macos·网络之路一天·华为华三数通基础·华为华三企业实战架构·华为中小型企业实战·华为华三计算机网络基础
心随_风动2 天前
主流操作系统对比分析(macOS、Linux、Windows、Unix)
linux·windows·macos
lxw18449125142 天前
macOS 系统设置息屏情况下,PHP等后台脚本继续执行
macos
Brian_Lucky2 天前
在 macOS 上合并 IntelliJ IDEA 的项目窗口
java·macos·intellij-idea