Lili is a self-hosted AI assistant for Telegram and the web. It learns from your chats over time: it can remember how you like your reports and turn a workflow that worked into a skill for next time. Send files or voice notes, research in the background, and schedule reminders or recurring tasks. Lili is under active development. MIT License
On a server with systemd, run:
bash -c '
lili_tmp=$(mktemp -d /tmp/lili-install.XXXXXXXX) &&
curl -fL https://github.com/onionj/lili-agent/releases/latest/download/install.sh -o "$lili_tmp/lili-install.sh" &&
sudo bash "$lili_tmp/lili-install.sh"
'The installer starts with the default instance on a fresh server. If Lili is already installed, enter an existing instance name to update it or a new name to create a separate instance. New installs ask for your model, API endpoint and key. For Telegram, enter your bot token and numeric Telegram user ID. If the server needs a proxy to reach Telegram, set TELEGRAM_PROXY_URL in the installer or instance .env (for example, socks5h://127.0.0.1:1080). HTTP, HTTPS and SOCKS5 proxies support optional URL-encoded credentials. Restart the service after editing the file. With Docker, use an address reachable from the container and recreate the container.
Choose the panel address during setup. Keep 127.0.0.1:8085 for access from the server, an SSH tunnel or a reverse proxy. Choose 0.0.0.0:8085 to listen on all IPv4 interfaces.
For HTTPS, install Certbot with your OS package manager, point a domain at the server, and make TCP port 80 available for certificate validation. Answer yes to HTTPS and enter the domain and email. If you answer yes without Certbot, setup stops with an error. Choose no to finish setup without requesting a certificate, then enable HTTPS later using the configuration command below. Once HTTPS is enabled, open https://your-domain:8085 with your chosen port and allow that port through your firewall for remote access.
For a fresh install, the installer generates an admin password, a JWT signing key, and separate Swagger credentials for /docs/index.html. Find the credentials in /opt/lili/.env for the default instance.
Download the latest installer and open the configuration prompts for the installed instance.
bash -c '
lili_tmp=$(mktemp -d /tmp/lili-install.XXXXXXXX) &&
curl -fL https://github.com/onionj/lili-agent/releases/latest/download/install.sh -o "$lili_tmp/lili-install.sh" &&
sudo bash "$lili_tmp/lili-install.sh" --configure
'Download the latest installer and run it again. The update reuses the existing configuration and data.
bash -c '
lili_tmp=$(mktemp -d /tmp/lili-install.XXXXXXXX) &&
curl -fL https://github.com/onionj/lili-agent/releases/latest/download/install.sh -o "$lili_tmp/lili-install.sh" &&
sudo bash "$lili_tmp/lili-install.sh"
'For a named instance, add --instance NAME to the sudo bash command.
The installer tracks instance paths in /opt/lili-agent-instances. Each instance keeps its configuration and data in its own installation directory.
New systemd installs default to Host access. Lili runs as root, and its file tool accepts absolute paths. Deleting a path outside the workspace requires Safety approval. Isolated uses a dedicated service account with systemd filesystem restrictions and keeps the file tool inside the workspace.
Choose an access mode in setup or --configure, or pass --access host or --access isolated. Updates keep the existing service identity. If your current Host installation still runs under a service account, explicitly choose host to switch it to root.
On a server with Docker, replace vX.Y.Z with a published image tag and download its configuration template into a new directory.
LILI_VERSION=vX.Y.Z
mkdir lili && cd lili &&
curl -fL "https://raw.githubusercontent.com/onionj/lili-agent/${LILI_VERSION}/.env.example" -o .env &&
chmod 600 .envSet INITIAL_ADMIN_PASS in .env (generate one with openssl rand -hex 16), set a separate JWT_SECRET (use openssl rand -hex 32), and enter your model settings. Run the published image with the tag for the version you want.
docker run -d --name lili --restart unless-stopped --init \
--security-opt no-new-privileges:true --env-file .env \
-e SERVER_ADDRESS=0.0.0.0:8085 -e LILI_DATA_DIR=/data \
-p 127.0.0.1:8085:8085 -v lili-data:/data \
"ghcr.io/onionj/lili-agent:${LILI_VERSION}"Open the local panel and sign in as admin with the password you set. The named volume lili-data holds your data. For public HTTPS, put a reverse proxy in front of the container.
From a checkout, copy .env.example to .env, run chmod 600 .env, and set the same credentials and model settings. Then run:
docker compose up -d --buildWith Compose, set LILI_BIND_ADDRESS and LILI_PORT in .env to change the host bind address or port.
Lili runs as root inside the container by default. Absolute paths refer to the container filesystem and any volumes you mount. For a new non-root installation, pass --user 10001:10001 to docker run or set LILI_CONTAINER_USER=10001:10001 in the Compose .env. Set LILI_ACCESS_MODE=isolated to confine the file tool to the workspace.
Install Go 1.26+, Make, and templ (go install github.com/a-h/templ/cmd/templ@v0.3.833). Prepare .env as above, then run from the repository root:
make run # Start the local panel at http://127.0.0.1:8085
make runtest # Regenerate templates and run the Go tests
make testcover # Generate coverage and open the HTML report
make build # Build the binary in dist/lili-agent
