About Gochat
gochat is a lightweight instant messaging system implemented in pure Go. It supports private messages and room broadcast messages, and its layers communicate through RPC and can be scaled out horizontally. The README is written in Chinese with an English version, and it is aimed at developers who want to learn from or build on an IM backend.
Clients can connect over WebSocket or TCP, and messages sent over one are delivered to the other. Components discover each other through etcd, which makes it easier to add servers when scaling, and Redis is used as the carrier for message storage and delivery, though it could be replaced by heavier brokers such as Kafka or RabbitMQ. The repository includes Docker support for building all environment dependencies in one step and a separate React UI project for a demo front end.
gochat is licensed under MIT and runs on your own infrastructure, with Go 1.18 or newer recommended for building. Documentation covers architecture, service discovery, message delivery, sequence diagrams and a simple load test, along with directory structure and database tables. It suits Go developers exploring distributed chat architecture.
Key features
- Private messages and room broadcasts
- WebSocket and TCP connections
- RPC between layers for horizontal scaling
- etcd-based service discovery
- Redis for message delivery
- Docker one-click environment setup
Good fit for
- →Learning distributed IM architecture in Go
- →Prototyping a chat backend
- →Running a small self-hosted chat service
- Built with
- Go
- Tags
- instant-messaging
- go
- websocket
- chat
- etcd
- redis
- distributed
- tcp
- im-server
Gochat: questions and answers
- What is Gochat used for?
- Gochat is a lightweight instant messaging system written in Go that supports private messages and room broadcasts over WebSocket and TCP with horizontal scaling. It is a good fit for learning distributed IM architecture in Go, prototyping a chat backend and running a small self-hosted chat service.
- Is Gochat open source?
- Yes. Gochat is open source under the MIT licence. Its source code is on GitHub at LockGit/gochat and is written mainly in Go.
- Is Gochat free?
- Yes. Gochat is open source, so the software itself is free to use.
- Can I self-host Gochat?
- Yes. Gochat can be self-hosted on your own server or infrastructure; there is no official hosted version.
- What are some alternatives to Gochat?
- Similar open-source tools in the Team Chat category include Stoat, Open OSCAR Server and Teamgram. SaaS products in the same category include Tencent QQ, Kik and Telegram.
- Is Gochat actively maintained?
- Yes. The most recent commit to Gochat was on 1 September 2026. The project has 2.9k stars on GitHub.
Open-source alternatives to Gochat
See all
Stoat
Team Chat
The software powering Stoat
OSSvs Discord★ 3.4kOpen OSCAR Server
Team Chat
Self-hostable instant messaging server compatible with classic AIM and ICQ clients written
MIT★ 1.6k
Teamgram
Team Chat
Unofficial open source mtproto server written in golang with compatible telegram client.
Apache-2.0vs Telegram★ 2.3k
Wildfire Chat Android
Team Chat
即时通讯,聊天,野火IM Android客户端,支持Android 4.x —— 最新
OSSvs WeChat★ 2.7k
MallChat
Team Chat
mallchat的前端项目,是一个既能购物又能聊天的电商系统。以互联网企业级开发规范的要求来实现它,电商该有的购物车,订单,支付,推荐,搜索,拉新,促活,推送,物流,客服,它都必须
Apache-2.0★ 1.2kChat.io
Team Chat
A Real Time Chat Application built using Node.js, Express, Mongoose, Socket.io, Passport,
MIT★ 1.4k
SaaS alternatives to Gochat
See allTencent QQ
Team Chat
Tencent instant messaging app with chat, file sharing and group features
SaaS
Kik
Team Chat
Mobile messaging app with private chats, public groups and communities
SaaS
Telegram
Team Chat
Cloud-based messenger with large groups, channels and bots
SaaS
8x8
Team Chat
Cloud phone, team chat and video meetings platform
SaaS
Anonymous Bot for Slack
Team Chat
Slack bot for sending anonymous messages to channels and teammates
SaaS
AutoPing
Team Chat
Discord bot that pings new members or roles on join and then deletes the pings
SaaS

