Self-hosting Letta
Learn how to run your own Letta server
The recommended way to use Letta locally is with Docker.
To install Docker, see Docker’s installation guide.
For issues with installing Docker, see Docker’s troubleshooting guide.
You can also install Letta using pip
.
Running the Letta Server
You can run a Letta server with Docker (recommended) or pip.
Running with Docker (recommended)
To run the server with Docker, run the command:
This will run the Letta server with the OpenAI provider enabled, and store all data in the folder ~/.letta/.persist/pgdata
.
If you have many different LLM API keys, you can also set up a .env
file instead and pass that to docker run
:
Running with pip
You can install the Letta server via pip
under the letta
package:
To run the server once installed, simply run the letta server
command:
To add LLM API providers, make sure that the environment variables are present in your environment.
Note that the letta
package only installs the server - if you would like to use the Python SDK (to create and interact with agents on the server in your Python code), then you will also need to install letta-client
package (see the quickstart for an example).
Once the Letta server is running, you can access it via port 8283
(e.g. sending REST API requests to http://localhost:8283/v1
). You can also connect your server to the Letta ADE to access and manage your agents in a web interface.
Enabling model providers
The Letta server can be connected to various LLM API backends (OpenAI, Anthropic, vLLM, Ollama, etc.). To enable access to these LLM API providers, set the appropriate environment variables when you use docker run
:
The example above will make all compatible models running on OpenAI, Anthropic, and Ollama available to your Letta server.
Password protection (advanced)
To password protect your server, include SECURE=true
and LETTA_SERVER_PASSWORD=yourpassword
in your docker run
command:
With password protection enabled, you will have to provide your password in the bearer token header in your API requests: