Building from sources (Android)


It is possible to run SCION on an Android device. The easiest way is to install SCION as an Android app. The other alternative is to manually install SCION on your Android device. Both variants are based on Termux, which emulates a Terminal environment with the Linux base system that Android is based upon.

This tutorial is primarily targeted at running a SCION end host on Android. While it is also possible to run an entire SCION AS, this currently doesn’t run stable within Termux, as it requires Apache Zookeeper, which frequently crashes the Termux environment as described here.


It is recommended to make yourself familiar with Termux by reading the Wiki to learn how the app can be used comfortably.


To install the SCION app, please contact Stefan Schwarz to get an invite to the App testing group.

Once you have been added to the group, you will receive an email with a link to the SCION App. Note that the SCION App is currently distributed through HockeyApp and thus requires to install it as well. This can be done through the HockeyApp website (it is not available on the Google Play Store).

Install SCION with the SCION App

Once the SCION App has been installed, open it and run the following command within the Terminal (Wifi connection recommended):


That’s it! The process takes a while but is fully automatic. At the end, a dialog opens which asks to select the ‘gen’ folder from internal memory. Select it to continue.

That means of course, that the ‘gen’ folder needs to be readily available on the internal memory. Download it directly or push it onto the device with ADB.

Manual setup

To setup SCION on Android manually, the Termux app needs to be installed from the Google Play Store.

To install SCION within Termux it is recommended to access the Termux environment via the Android Debug Bridge (ADB) or via SSH.

Access Termux via SSH

First install the openssh package within Termux with pkg install openssh, then start the server with sshd. Password authentication is not supported, so you need to add your public key to $HOME/.ssh/authorized_keys. The ssh server runs by default on port 8022, so connect to it with ssh -p 8022 DEVICE_IP. You can find the device IP address with ip addr list wlan0.

For more information: Run an SSH server on your Android with Termux Access Termux via USB

Install necessary packages

Install the required packages from within Termux:

apt update && apt upgrade
pkg install -y termux-exec git python python2 clang make python-dev libffi-dev openssl-dev openssl-tool curl

To access the SD card from Termux, it is required to run termux-setup-storage from the Termux console.

Configure Go workspace

SCION requires a specific Go version. The Termux Go package may be ahead of that version. The following repository offers prebuilt golang packages in the required version for both ARMv7 & ARMv8/aarch64 architectures:

For ARMv7:

curl -O
curl -O
dpkg -i golang_2%3A1.9.4_aarch64.deb golang-doc_2%3A1.9.4_aarch64.deb

For aarch64:

curl -O
curl -O
dpkg -i golang_2%3A1.9.4_aarch64.deb golang-doc_2%3A1.9.4_aarch64.deb

Setup the Go workspace and add it to your path:

echo 'export GOPATH="$HOME/go"' >> ~/.profile
source ~/.profile
mkdir -p "$GOPATH/bin"
echo 'PATH=$PATH:$GOPATH/bin' >> ~/.profile
source ~/.profile

Install SCION

Step One – clone the SCION repository

After the Go workspace has been configured, we can checkout SCION with the required Termux modifications from Github and apply a required patch using the following commands:

mkdir -p "$GOPATH/src/"
cd "$GOPATH/src/"
git config --global url.
git clone --recursive -b termux-modifications .

curl -O
patch sub/lwip-contrib/ports/unix/proj/scion/Makefile lwip-contrib.patch
rm lwip-contrib.patch

This will clone the appropriate SCION directory into your Go workspace. We will create an environment variable SC that will point to the SCION root directory. Afterwards it is necessary to navigate to the newly downloaded repository for finishing the configuration:

echo 'export SC="$GOPATH/src/"' >> ~/.profile
source ~/.profile
cd $SC

Step Two – configure Python path variable

Some SCION components like SCIONviz require Python libraries which are located in the SCION root directory. In order to make them accessible, the PYTHONPATH environment variable needs to be exported:

echo 'export PYTHONPATH="$SC/python:$SC"' >> ~/.profile
source ~/.profile

Step Three – install required packages/patches

SCION has an install script to install all necessary dependencies. In the Termux environment, however, this is not yet working. So the dependencies have to be installed manually.

Cap’n Proto

To install Cap’n Proto in Termux run the following commands in the home/ directory:

curl -O
tar zxf capnproto-c++-0.6.1.tar.gz
cd capnproto-c++-0.6.1

On Termux Cap’n Proto requires some patching to compile:

cd src/kj/
curl -O
patch debug.c++ debug.c++.patch
rm debug.c++.patch

Back in the capnproto-c++-0.6.1/ root directory run:

./configure --prefix=$PREFIX TMPDIR=$PREFIX/tmp
make install


Install zlog by following its install instructions mostly. It requires some more patching and the installation of libandroid-glob-dev:

curl --output zlog-latest-stable.tar.gz
tar -zxf zlog-latest-stable.tar.gz
cd zlog-latest-stable/
curl -O
patch src/makefile zlog-makefile.patch
rm zlog-makefile.patch

pkg install -y libandroid-glob-dev
make PREFIX=$PREFIX install


Install the uthash library from your home/ directory:

curl -o
cp uthash-master/src/*.h $PREFIX/include
rm -rf uthash-master/

SCION Python dependencies

Most of the Python dependencies can easily be installed through pip:

cd $SC
pip2 install -r env/pip2/requirements.txt
pip3 install -r env/pip3/requirements.txt
TMPDIR=$PREFIX/tmp pip3 install lz4 PyNaCl PyYAML Pygments

SCION Go dependencies

With Go correctly installed it is easy to install the SCION dependencies as well:

cd $SC/env/go

Next steps

After finishing the installation of SCION, there are different ways of running different topologies. The following tutorials will cover this in further detail:

  1. Connecting to SCIONLab as an endhost – Connect to the already running SCION topology as a mobile end host through an existing SCION setup.

Changes to gen folder

Note that in gen/ISDx/AS10xx/supervisord.conf the path of the SCION Deamon socket needs to be changed as follows: "--api-addr" "/data/data/com.termux/files/run/shm/sciond/sdX-10XX.sock".

VPN Connection to SCIONLab

Unfortunately, OpenVPN is not currently supported from within the Termux environment. Alternatively, the Open VPN app can be installed to connect to SCIONLab via VPN. The client.conf file that is provided by the SCIONLab coordinator needs to be renamed to client.ovpn before it can be imported into the app. Additionally, the line route needs to be added to the file.

End host configuration vs. full AS

It is possible to run the full SCION on Android, it is, however, currently not recommended. The full SCION requires a Zookeeper instance which itself is a Java program. While it is possible to install a Java Virtual Machine in Termux, the actual Termux packages have been disabled or removed due to instabilities with high CPU usage.

If you still want to try the full SCION on an Android phone, we suggest to use a remote Zookeeper instance running on another device and configuring the own SCION topology accordingly.