Air-Gapped Deployment
Export deployment artifacts on an online builder and run them offline.
The air-gapped deployment flow is to run mage export on an internet-connected build machine, then copy the exported deployment packages to the target machine on the private network.
Version and overall process
main is the development branch for unreleased continuous-integration changes. For an air-gapped production environment, use the latest official release marked Latest on GitHub Releases, or a stable tag explicitly verified by your team.
- Check out stable OpenIMServer and ChatServer releases on an internet-connected build machine.
- Run
mage exportto produce archives that can be transferred into the private network. - Copy the archives, configuration, and external component packages to the target machine.
- Extract the archives and use the bundled
./mageexecutable to start and check the services.
Prepare external components
The OpenIMServer and ChatServer exports contain only the application services. Prepare MongoDB, Redis, Kafka, Etcd, and MinIO separately.
The target machine uses Docker
On an internet-connected machine, download Docker offline packages matching the target operating system and architecture:
- Debian / Ubuntu:
.debpackages fordocker-ce,docker-ce-cli,containerd.io,docker-buildx-plugin, anddocker-compose-plugin. - RHEL / CentOS: the corresponding
.rpmpackages.
After installation, use docker load to import the external component images saved in advance.
The target machine does not use Docker
Copy official MongoDB, Redis, Kafka, Etcd, and MinIO binaries or internal artifacts to the target, then run them with systemd, supervisor, or internal scripts. OpenIMServer and ChatServer only require correct component addresses and credentials; Docker is not required on the target.
Export OpenIMServer on the build machine
git clone https://github.com/openimsdk/open-im-server && cd open-im-server
git fetch --tags
LATEST_STABLE_TAG=$(basename "$(curl -fsSLI -o /dev/null -w '%{url_effective}' https://github.com/openimsdk/open-im-server/releases/latest)")
git checkout "$LATEST_STABLE_TAG"
bash bootstrap.sh
PLATFORMS="linux_amd64" mage exportThe archive is written to _output/export/ by default, with a name such as:
exported_open-im-server_v3.8.3-patch.12_linux_amd64.tar.gzExport ChatServer on the build machine
git clone https://github.com/openimsdk/chat && cd chat
git fetch --tags
LATEST_STABLE_TAG=$(basename "$(curl -fsSLI -o /dev/null -w '%{url_effective}' https://github.com/openimsdk/chat/releases/latest)")
git checkout "$LATEST_STABLE_TAG"
bash bootstrap.sh
PLATFORMS="linux_amd64" mage exportThe filename is similar to:
exported_chat_v1.8.4-patch.3_linux_amd64.tar.gzThe export contains compiled binaries, start-config.yml, runtime configuration, and a Mage launcher that runs on the target. The target does not need Go and does not rebuild the source.
Copy deployment materials
Copy the OpenIMServer archive, ChatServer archive, external component images or binaries, and the actual configuration, including domains, component addresses, secret values, and the MinIO externalAddress.
Deploy external components on the target
With Docker, import each image and start it using the prepared orchestration files:
docker load -i image-name.tarWithout Docker, start MongoDB, Redis, Kafka, Etcd, and MinIO in order, then enter their addresses and credentials in the OpenIMServer and ChatServer configuration.
Start OpenIMServer
mkdir -p /opt/openim/open-im-server
tar -xzf exported_open-im-server_v*.tar.gz -C /opt/openim/open-im-server
cd /opt/openim/open-im-serverAfter configuring external components, secret, and the MinIO externalAddress, start the service:
./mage check
./mage start
./mage checkStart ChatServer
mkdir -p /opt/openim/chat
tar -xzf exported_chat_v*.tar.gz -C /opt/openim/chat
cd /opt/openim/chatAfter configuring Redis, MongoDB, Etcd, and the OpenIMServer secret, start it:
./mage check
./mage start
./mage checkCommon operations
For OpenIMServer:
cd /opt/openim/open-im-server
./mage check
./mage stop
./mage startFor ChatServer:
cd /opt/openim/chat
./mage check
./mage stop
./mage startNotes
- Do not build air-gapped production packages from
main. - Use the bundled
./mageon the target instead of repeating the source-build process. - When build and target architectures differ, set
PLATFORMSto the target, for examplelinux_amd64orlinux_arm64. - Whether dependencies use Docker or native binaries, their addresses and credentials must match the OpenIMServer and ChatServer configuration.