On Android, KoboldCpp runs inside the Termux terminal app and is compiled on the device. An official script does the setup for you.
Install Termux from F-Droid.
Open Termux and run the setup script:
Termux curl -sSL https://raw.githubusercontent.com/LostRuins/koboldcpp/concedo/android_install.sh | shRun this way, the script installs KoboldCpp and starts it with a small Gemma3-1B model.
When it has loaded, open
http://localhost:5001in your phone's browser.
Choosing a different model
Section titled “Choosing a different model”Download the script and run it yourself to get a menu:
curl -sSLO https://raw.githubusercontent.com/LostRuins/koboldcpp/concedo/android_install.shchmod +x android_install.sh./android_install.sh| Option | What it does |
|---|---|
| 1 | Install and launch with Gemma3-1B |
| 2 | Install without a model |
| 3 | Download a GGUF model from a URL |
| 4 | Load a GGUF model that is already on the device |
| 5 | Exit |
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.
cd koboldcppbash android_install.shUse a small model. See Choose a model.
What the script does
Section titled “What the script does”- Stops if it is not running on Android.
- If
wget,gitorpythonis missing, runsapt update, installsopenssl,wget,gitandpython, and runspkg upgrade. - Clones the KoboldCpp repository, unless it finds an existing copy.
- Compiles it with
make -j 2, unless a build already exists. - Starts it with
python koboldcpp.py --model <model>.
Updating
Section titled “Updating”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:
cd koboldcppgit pullmakeAdvanced: manual setup
Section titled “Advanced: manual setup”pkg updatepkg upgradepkg install openssl wget git python clang makegit clone https://github.com/LostRuins/koboldcpp.gitcd koboldcppmakepython koboldcpp.py --model mymodel.ggufDownload 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-repoand pick another mirror. Illegal instructionon your device: rebuild withmake clean, thenmake 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.