Files
LocalAI/docs/content/installation/linux.md
Igor B. Poretsky ab022172a9 chore: switch from /usr/share to /var/lib for data storage (#7361)
* More appropriate place for data storing

The /usr/share subtree in Linux is used for data that generally are not
supposed to change. Conventional places for changeable data are usually
located under /var, so /var/lib seems to be a reasonable default here.

* Data paths consistency fix

* Directory name consistency fix
2025-11-27 09:18:28 +01:00

3.5 KiB

title, description, weight, url
title description weight url
Linux Installation Install LocalAI on Linux using the installer script or binaries 3 /installation/linux/

The fastest way to install LocalAI on Linux is with the installation script:

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

This script will:

  • Detect your system architecture
  • Download the appropriate LocalAI binary
  • Set up the necessary configuration
  • Start LocalAI automatically

Installer Configuration Options

The installer can be configured using environment variables:

curl https://localai.io/install.sh | VAR=value sh

Environment Variables

Environment Variable Description
DOCKER_INSTALL Set to "true" to enable the installation of Docker images
USE_AIO Set to "true" to use the all-in-one LocalAI Docker image
USE_VULKAN Set to "true" to use Vulkan GPU support
API_KEY Specify an API key for accessing LocalAI, if required
PORT Specifies the port on which LocalAI will run (default is 8080)
THREADS Number of processor threads the application should use. Defaults to the number of logical cores minus one
VERSION Specifies the version of LocalAI to install. Defaults to the latest available version
MODELS_PATH Directory path where LocalAI models are stored (default is /var/lib/local-ai/models)
P2P_TOKEN Token to use for the federation or for starting workers. See [distributed inferencing documentation]({{%relref "features/distributed_inferencing" %}})
WORKER Set to "true" to make the instance a worker (p2p token is required)
FEDERATED Set to "true" to share the instance with the federation (p2p token is required)
FEDERATED_SERVER Set to "true" to run the instance as a federation server which forwards requests to the federation (p2p token is required)

Image Selection

The installer will automatically detect your GPU and select the appropriate image. By default, it uses the standard images without extra Python dependencies. You can customize the image selection:

  • USE_AIO=true: Use all-in-one images that include all dependencies
  • USE_VULKAN=true: Use Vulkan GPU support instead of vendor-specific GPU support

Uninstallation

To uninstall LocalAI installed via the script:

curl https://localai.io/install.sh | sh -s -- --uninstall

Manual Installation

Download Binary

You can manually download the appropriate binary for your system from the releases page:

  1. Go to GitHub Releases
  2. Download the binary for your architecture (amd64, arm64, etc.)
  3. Make it executable:
chmod +x local-ai-*
  1. Run LocalAI:
./local-ai-*

System Requirements

Hardware requirements vary based on:

  • Model size
  • Quantization method
  • Backend used

For performance benchmarks with different backends like llama.cpp, visit this link.

Configuration

After installation, you can:

  • Access the WebUI at http://localhost:8080
  • Configure models in the models directory
  • Customize settings via environment variables or config files

Next Steps