Repository navigation
Install Termux Proot
Plain Termux cannot run the Nationdex binaries. Termux is built on Android's own C library (Bionic), not glibc. The Linux binaries and their native libraries (
skia,gifsx) are built for glibc Linux, and some modules, including TypeScript 7.0.2's native compiler, have no Android build. You must run everything inside Proot-Distro (Debian), as described below. The same goes for building from source.
Run the bot on an Android phone or tablet with Termux, and Proot-Distro for a full Debian Linux inside it. The Linux ARM64 binary runs there.
Heads up: a phone is a fragile server. Android can stop Termux when the screen is off or the battery is low. Use a dedicated old phone, keep it plugged in, and see Hosting.
Install Termux from F-Droid (https://f-droid.org). The Play Store build is outdated and will not update its packages.
Open Termux and update it:
pkg update && pkg upgrade -y
pkg install -y proot-distroproot-distro install debian
proot-distro login debianYou are now inside Debian. Your prompt changes. Everything below runs inside Debian unless stated otherwise.
If curl or apt cannot reach the internet inside Debian, DNS is the usual cause. Android resolves names through its own services, not /etc/resolv.conf, and Proot-Distro has to guess a nameserver. Some networks (hotspots, school or work Wi-Fi, some ISPs, VPN or Private DNS) block that guess.
Check and fix, inside Debian:
cat /etc/resolv.conf
echo "nameserver 1.1.1.1" > /etc/resolv.conf
echo "nameserver 9.9.9.9" >> /etc/resolv.conf
curl -I https://github.comProot-Distro may rewrite that file on the next login, so check it again if the error comes back.
Workaround without touching DNS: download in Termux itself (outside Debian), which uses Android's resolver, then copy the file into Debian:
# in Termux (not Debian)
pkg install -y curl
curl -LO https://github.com/nationdex/bot/releases/download/v1.0.0/nationdex-bot-linux-arm64.tar.gz
cp nationdex-bot-linux-arm64.tar.gz $PREFIX/var/lib/proot-distro/installed-rootfs/debian/root/Inside Debian the file is then in /root/. Download SHA256SUMS.txt the same way and verify it.
apt update && apt upgrade -y
apt install -y curl ca-certificates tar nanoPhones use ARM64. Check with uname -m, which should print aarch64.
mkdir -p ~/nationdex && cd ~/nationdex
curl -LO https://github.com/nationdex/bot/releases/download/v1.0.0/nationdex-bot-linux-arm64.tar.gz
curl -LO https://github.com/nationdex/bot/releases/download/v1.0.0/SHA256SUMS.txt
sha256sum -c SHA256SUMS.txt --ignore-missing
tar -xzf nationdex-bot-linux-arm64.tar.gz
chmod +x nationdex-bot-linux-arm64The sha256sum line must print nationdex-bot-linux-arm64.tar.gz: OK.
The archive already holds the native libraries, assets/ and the panel. Create .env (see Configuration):
cp .env.example .env
nano .env # TOKEN and HOME_GUILD_IDNation artwork (assets/spawn_art, assets/window_art) is not shipped: add your own, see Install: Binaries.
./nationdex-bot-linux-arm64To leave it running after you close the terminal, use tmux:
apt install -y tmux
tmux new -s nationdex
./nationdex-bot-linux-arm64
# detach: press Ctrl+B then D. Reattach later with: tmux attach -t nationdex-
exitleaves Debian and returns to Termux. - Later,
proot-distro login debiangets you back in. Your files stay in~/nationdexinside Debian.
- The API and the panel are reachable from the phone's browser at
http://localhost:3000. From other devices on the same Wi-Fi, use the phone's LAN IP andPANEL_PORT, and setPANEL_HOST=0.0.0.0. -
termux-wake-lock(from the Termux:API app) asks Android not to sleep Termux. Untested here, so check it on your phone. - The ARM64 binary was smoke-tested in an emulated ARM64 Debian container (it boots and reaches the Discord login). It was not tested on a real phone. If the binary fails to start, see Troubleshooting.