F‑Droid is an open‑source app store that serves only free and open‑source Android applications. By default it pulls packages from the public F‑Droid server, which requires an internet connection and trusts the central signing key. In many situations—air‑gapped environments, corporate devices, or simply a desire to keep a curated set of apps—you may want a repository that lives entirely on your own device or local network. This tutorial shows how to build such a repository without rooting the phone, keeping the process fully under your control.
If you have a PC handy, you can generate the repository there and copy it to the phone later, but the whole workflow can be completed on the device itself.
Open Termux and run the following commands. They install the Python runtime, the fdroidserver toolset, and a tiny HTTP server.
pkg update && pkg upgrade -y
pkg install python git openssl -y
pip install --upgrade pip
pip install fdroidserver
Why this matters: fdroidserver handles metadata creation and signing, while python -m http.server will host the repository locally.
F‑Droid repositories must be signed with an RSA key. Keep this key safe; anyone who obtains it can inject malicious apps.
cd ~
mkdir repo && cd repo
fdroid init
The fdroid init command creates a repo directory containing a keystore sub‑folder and a default config.py. It also prompts you for a password and some identifying information. Remember the password.
Inside the repo folder, create the folders that will hold the APKs and the generated metadata.
mkdir -p repo/apks repo/metadata
All APK files you wish to serve must be placed in repo/apks.
Copy the desired APKs into the repo/apks directory. You can use the Android file picker, adb push, or Termux’s cp command.
# Example: copy a downloaded APK from Downloads
cp ~/storage/downloads/example-app.apk repo/apks/
Make sure each APK is a genuine, unmodified file. If you obtained the APK from the public F‑Droid server, you can verify its signature later (see the troubleshooting section).
Run the metadata generation script. This step reads each APK, extracts its manifest, and writes index-v1.json and index-v2.json files.
fdroid update -v
The -v flag shows progress. If the command finishes without error, you will see a repo folder populated with metadata files and a repo index file.
Next, sign the repository so the F‑Droid client trusts it:
fdroid sign
You will be prompted for the keystore password you set earlier. After signing, a file named repo (no extension) appears; this is the signed index the client will download.
Start a simple HTTP server from the repo directory. The server will listen on port 8080 by default.
cd repo
python -m http.server 8080
Leave this terminal window open; closing it stops the server. The repository is now reachable at http://127.0.0.1:8080/ (or http:// if you want another device on the same LAN to access it).
http://127.0.0.1:8080/. If you are accessing it from another device, replace 127.0.0.1 with the phone’s local IP address (e.g., http://192.168.1.42:8080/).If the verification succeeds, you’ll see a new section in the app’s main list named after your repository (by default “Local repo”).
Refresh the repository by pulling down on the main screen. The apps you placed in repo/apks should now appear. Tap any app, then press Install. The installation proceeds exactly like any other F‑Droid app, using the package manager without root.
After installation, you can verify the signature in Settings ► Apps ► Your App ► App details ► Signature (the exact path varies by manufacturer). It should match the fingerprint of the keystore you created.
repo/apks.fdroid update -v followed by fdroid sign again.http:// (not https://) and the correct port (8080 by default).python -m http.server is still active.targetSdkVersion is compatible with your device.pkg upgrade -y regularly to receive security patches for the underlying tools.With these steps you now have a fully functional, signed, offline F‑Droid repository that works on any Android device without requiring root access. Use it to distribute internal tools, maintain a curated set of privacy‑focused apps, or simply keep a backup of your favorite open‑source software when you’re away from the internet.









