Skip to main content

Install LocalAI

Install the server with a script, a binary, a container or Helm. Windows has a PowerShell install script and a native binary. The desktop app, which installs and runs the server for you, is in the 5.0 release.

You haveUseCommand or guide
Linux, or a Mac with Apple SiliconInstall scriptSee below
Linux or macOS, and you want to choose the fileBinaryBinary
Windows on amd64PowerShell script or binaryWindows
An Intel Mac, a server, or a GPU imageContainerContainers
A clusterHelm chartKubernetes
An Android phone, and a server to connect toAndroid appAndroid app
A change to the codeSourceBuild from source

Install script

The script downloads the release binary for your machine, checks it against the checksums of the release, and puts it on your PATH. It builds nothing. Running it twice changes nothing.

curl -sSL https://localai.io/install.sh | sh

The script installs the local-ai program and does not start it. If the script says the folder is not on your PATH, run the export line it prints. After the script, run local-ai, open http://localhost:8080 and install a model from the UI. The quickstart has the details.

If a release has no checksum file, the script says so and installs without checking.

You can set these environment variables before the command:

VariableEffect
LOCALAI_VERSIONInstall a given release, for example v4.7.1. The default is the latest release.
INSTALL_DIRInstall into this folder. The default is /usr/local/bin, using sudo when the folder is not writable and sudo is available. Without sudo, or with LOCALAI_NO_SUDO=1, the script uses ~/.local/bin.
LOCALAI_FORCESet to 1 to install again when the same build is present.
LOCALAI_NO_SUDOSet to 1 to never ask for sudo. LocalAI then installs into ~/.local/bin.
GITHUB_TOKENA GitHub token, used only to avoid GitHub API rate limits when the script looks up the latest release.

The script supports Linux on amd64 and arm64, and macOS on arm64 (Apple Silicon). There is no binary for Intel Macs. Use a container there. On Windows, use the PowerShell script in Windows.

Install a worker

The script has a worker mode that installs the binary and then a service that runs local-ai worker and joins a cluster. You normally do not type this yourself: an admin mints a join token on the Workers page (Add worker), and the page gives you a command such as curl -fsSL 'https://ai.example.com/join.sh?t=...' | sudo sh, which runs this mode. See Join tokens.

LOCALAI_REGISTER_TO=https://ai.example.com LOCALAI_JOIN_TOKEN=ljt_... sudo -E sh install.sh --worker

Run it as root. It writes a systemd unit on Linux (a launchd daemon on macOS, not tested on every macOS version), keeps the settings in /etc/localai/worker.env (readable by root only), and starts the service. The join token is read from the environment, never from a command line, and the script never prints it. Running it again is safe: the worker keeps its own credential in its state directory and needs the token once.

VariableEffect
LOCALAI_REGISTER_TOThe URL of the frontend. Required.
LOCALAI_JOIN_TOKENThe join token. Required the first time.
LOCALAI_WORKER_ROUTESnats, websocket or both. Optional.
LOCALAI_WORKER_NAMEThe node name. The default is the host name.
LOCALAI_WORKER_DIRThe state directory (models, backends, credential). The default is /var/lib/local-ai on Linux.

To remove the worker: sudo systemctl disable --now localai-worker, then remove /etc/localai/worker.env, /etc/systemd/system/localai-worker.service and the state directory, and delete the worker on the Workers page.

Container

curl -fsSL https://localai.io/install/docker-compose.yaml -o docker-compose.yaml
docker compose up -d

The compose file runs the CPU image and keeps models, backends, settings and data in named volumes. For GPU images, docker run, Podman and file permissions, see Containers.

Desktop app

The desktop app installs, updates, starts and stops the LocalAI server on your computer and shows the web interface in a window. It can also connect to a LocalAI server that runs somewhere else.

The 5.0 release has the DMG for a Mac with Apple Silicon and the AppImages for Linux (x86-64 and ARM64). Later releases also have a Windows installer for x86-64. Download them from the latest release. See Desktop app for the steps, the first start, the update channels and troubleshooting.

Android app

The Android app shows the web interface of a LocalAI server on your phone. It runs nothing on the phone. It connects to a server by its address, or over P2P with an invite link. See Android app for the install steps, the sign-in, P2P and updates.

Development builds

Every push to the master branch that changes the code is built and published to one rolling pre-release, tagged dev-master: github.com/mudler/LocalAI/releases/tag/dev-master. Each new build replaces the files of the last one. The release notes give the commit of the build.

A development build is not supported. It can have bugs and it can change without notice. Use a stable release for anything that matters. The dev-master release is a pre-release, so the install script and the “latest” download links never use it.

The release has these files:

FilePlatform
local-ai-master-linux-amd64Linux, x86-64
local-ai-master-linux-arm64Linux, ARM64
local-ai-master-darwin-arm64macOS, Apple Silicon

Each file has a checksum file with the same name and the suffix .sha256. To download and verify a binary:

base=https://github.com/mudler/LocalAI/releases/download/dev-master
curl -fLO "$base/local-ai-master-linux-amd64"
curl -fLO "$base/local-ai-master-linux-amd64.sha256"
sha256sum --check local-ai-master-linux-amd64.sha256
chmod +x local-ai-master-linux-amd64
./local-ai-master-linux-amd64

On macOS, use shasum -a 256 --check instead of sha256sum --check. The command must print OK. If it does not, delete the files and download them again.

The Development update channel of the desktop app downloads these binaries.

What next

Run a first model with the quickstart.