Kimaki supports running multiple bot instances on a single machine, each with its own database, project directory, and Discord bot. This is useful for separating work environments, teams, or testing.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/remorses/kimaki/llms.txt
Use this file to discover all available pages before exploring further.
Architecture
Each Kimaki instance has:- Separate Discord bot - Different bot token and Application ID
- Isolated database - Independent
discord-sessions.dbfile - Dedicated projects directory - Where
/create-new-projectcreates folders - Unique lock port - Prevents conflicts between instances
Default Instance
The default instance uses:- Data directory:
~/.kimaki - Database:
~/.kimaki/discord-sessions.db - Projects:
~/.kimaki/projects - Lock port:
29988(or derived from data dir hash)
Additional Instances
Run additional instances with--data-dir and KIMAKI_LOCK_PORT:
Create Second Discord Bot
Follow the Discord Setup guide to create another Discord application and bot.
Each instance needs its own Discord bot. You cannot share bot tokens between instances.
Example: Three Instances
- Runs independently
- Can be in the same Discord server (different bots)
- Accesses different project directories on your machine
- Has isolated session history and preferences
Lock Port Behavior
Automatic Port Assignment: If you don’t setKIMAKI_LOCK_PORT, Kimaki derives a port from the data directory path:
- Default
~/.kimaki→ Port29988(backwards compatible) - Custom dirs → Port in range
30000-39999(hash-based)
KIMAKI_LOCK_PORT to override the derived port:
Use manual port assignment if the auto-derived port conflicts, or if you want predictable port numbers.
Process Management
Run each instance in a separate terminal or use a process manager: tmux (recommended):/etc/systemd/system/:
Switching Between Instances
To switch a project from one instance to another:Add Project to New Instance
Run the new instance and use
/add-project or npx kimaki project add to create channels.Use Cases
Team Separation: Run separate bots for different teams, each with isolated projects and session history. Work/Personal Split: Keep work and personal projects completely separate with different bots and data directories. Testing: Run a test instance with a separate bot to experiment without affecting production channels. Multiple Machines: If you have multiple machines (desktop, laptop, server), create a bot for each. Install all bots in the same Discord server for centralized access.Troubleshooting
Error: Lock port already in use Another process is using the lock port. Either:- Set a different
KIMAKI_LOCK_PORT - Stop the other Kimaki instance
- Check for stale processes:
lsof -i :29988
<app> tag.
Database locked errors
Each data directory should only be used by one instance at a time. Don’t run multiple instances with the same --data-dir.
Next Steps
Discord Setup
Create additional Discord bots
Best Practices
Organize your Kimaki deployment