Skip to content
KoboldCpp
GitHub

Install on Android with Termux

On Android, KoboldCpp runs inside the Termux terminal app and is compiled on the device. An official script does the setup for you.

  1. Install Termux from F-Droid.

  2. Open Termux and run the setup script:

    Termux
    curl -sSL https://raw.githubusercontent.com/LostRuins/koboldcpp/concedo/android_install.sh | sh

    Run this way, the script installs KoboldCpp and starts it with a small Gemma3-1B model.

  3. When it has loaded, open http://localhost:5001 in your phone's browser.

Download the script and run it yourself to get a menu:

Termux
curl -sSLO https://raw.githubusercontent.com/LostRuins/koboldcpp/concedo/android_install.sh
chmod +x android_install.sh
./android_install.sh
OptionWhat it does
1Install and launch with Gemma3-1B
2Install without a model
3Download a GGUF model from a URL
4Load a GGUF model that is already on the device
5Exit

Options 3 and 4 need an existing install. Run them from the koboldcpp folder, which has its own copy of the script. Option 4 only lists .gguf files in that folder.

Termux
cd koboldcpp
bash android_install.sh

Use a small model. See Choose a model.

  1. Stops if it is not running on Android.
  2. If wget, git or python is missing, runs apt update, installs openssl, wget, git and python, and runs pkg upgrade.
  3. Clones the KoboldCpp repository, unless it finds an existing copy.
  4. Compiles it with make -j 2, unless a build already exists.
  5. Starts it with python koboldcpp.py --model <model>.

Running the script again does not rebuild KoboldCpp: it skips compiling when a build already exists. To update, pull the new source and compile it again:

Termux
cd koboldcpp
git pull
make
Termux
pkg update
pkg upgrade
pkg install openssl wget git python clang make
git clone https://github.com/LostRuins/koboldcpp.git
cd koboldcpp
make
python koboldcpp.py --model mymodel.gguf

Download a small GGUF model into the folder first, or pass a model URL to --model. Then open http://localhost:5001.

  • Packages fail to install: run termux-change-repo and pick another mirror.
  • Illegal instruction on your device: rebuild with make clean, then make LLAMA_PORTABLE=1, which turns off tuning for your specific processor.
  • GPU: these instructions cover CPU builds. GPU acceleration depends on the device and its drivers.

More: OS-specific problems.