In my previous post, I explored why mobile SoCs make compelling lab hardware and demonstrated that a Snapdragon 835 can hold its own against modern single-board computers. I even showed a live dashboard running Prometheus and Node Exporter on this setup. Now, let’s get practical, I’ll show you exactly how to deploy a complete observability stack on your mobile SoC. 📊🚀

🎯 What We’re Building Link to heading

By the end of this guide, you’ll have a fully functional monitoring setup running on your Android device:

  • Grafana - For beautiful dashboards and visualization
  • Prometheus - For metrics collection and time-series storage
  • Node Exporter - For system metrics (CPU, memory, disk, network)

This setup is perfect for monitoring your homelab, learning about observability, or just proving that your old smartphone is more powerful than you thought! 💪

📋 Prerequisites Link to heading

Before we dive in, make sure you have:

1. Termux Installed Link to heading

Termux is a powerful terminal emulator and Linux environment for Android. It’s the foundation of our entire setup.

2. Root Access (for Node Exporter) Link to heading

Node Exporter requires root privileges to access certain system metrics. You’ll need:

  • A rooted Android device
  • Termux:Boot (optional, for auto-start on boot)

3. Storage and Network Link to heading

  • At least 500MB free storage
  • Stable Wifi network connection

4. Basic Terminal Skills Link to heading

Familiarity with basic Linux commands will help, but I’ll walk you through each step. 🎓

5. Install Termux Services Link to heading

We’ll use termux-services to manage our observability stack cleanly with sv commands instead of using nohup. This provides proper service management similar to systemd on traditional Linux systems.

Install termux-services:

pkg install termux-services -y

🚀 Part 1: Installing Grafana Link to heading

Grafana is the easiest component to install, thanks to Termux’s excellent package repository.

Step 1: Update Package Lists Link to heading

First, ensure your Termux packages are up to date:

pkg update && pkg upgrade -y

Step 2: Install Grafana Link to heading

Install Grafana directly from the Termux repository:

pkg install grafana -y

That’s it! The package manager handles all dependencies automatically. ✨

Step 3: Set Up Grafana as a Service Link to heading

Instead of using nohup, let’s properly manage Grafana as a service using sv.

Create a service directory for Grafana:

mkdir -p $PREFIX/var/service/grafana
mkdir -p $PREFIX/var/service/grafana/log

Create the run script:

cat > $PREFIX/var/service/grafana/run << 'EOF'
#!/data/data/com.termux/files/usr/bin/sh
exec grafana server --homepath $PREFIX/share/grafana/ 2>&1
EOF

cd $PREFIX/var/service/grafana/log
ln -sf $PREFIX/share/termux-services/svlogger run

Make the scripts executable:

chmod +x $PREFIX/var/service/grafana/run

Enable and start the Grafana service:

sv-enable grafana
sv up grafana

💡 Pro Tip: You can check if Grafana is running with:

sv status grafana

By default, Grafana runs on port 3000. You can access it by opening a browser and navigating to:

http://<mobile-phone-ip>:3000

Default credentials:

  • Username: admin
  • Password: admin (you’ll be prompted to change this on first login)

📦 Part 2: Installing Prometheus Link to heading

Prometheus isn’t available in the Termux repository, so we’ll install it from the official GitHub releases.

Step 1: Install Required Dependencies Link to heading

pkg install wget tar -y

Step 2: Download Prometheus Link to heading

Visit the Prometheus releases page to find the latest ARM64 version. At the time of writing, the latest version is 3.x.x.

For ARM64 (which is what Snapdragon 835 uses):

cd $HOME
wget https://github.com/prometheus/prometheus/releases/download/v3.5.1/prometheus-3.5.1.linux-arm64.tar.gz

⚠️ Note: Replace 3.5.1 with the latest version number from the releases page.

Step 3: Extract the Tarball Link to heading

tar -xzf prometheus-3.5.1.linux-arm64.tar.gz
mv prometheus-3.5.1.linux-arm64 prometheus

Step 4: Set Up Prometheus as a Service Link to heading

Create a service directory for Prometheus:

mkdir -p $PREFIX/var/service/prometheus
mkdir -p $PREFIX/var/service/prometheus/log

Create the run script:

cat > $PREFIX/var/service/prometheus/run << 'EOF'
#!/data/data/com.termux/files/usr/bin/sh

exec $HOME/prometheus/prometheus --config.file=$HOME/prometheus/prometheus.yml --storage.tsdb.path $HOME/prometheus/ --storage.tsdb.retention.time 14d 2>&1
EOF

cd $PREFIX/var/service/grafana/log
ln -sf $PREFIX/share/termux-services/svlogger run

Make the scripts executable:

chmod +x $PREFIX/var/service/prometheus/run

Enable and start the Prometheus service:

sv-enable prometheus
sv up prometheus

Verify it’s running:

sv status prometheus

🔍 Part 3: Installing Node Exporter (Root Required) Link to heading

Node Exporter exposes hardware and OS metrics that Prometheus can scrape. This requires root access to read certain system files.

Step 1: Install Sudo (Root Shell) Link to heading

Install sudo for a proper root environment in Termux:

pkg install sudo -y

Step 2: Download Node Exporter Link to heading

cd $HOME
wget https://github.com/prometheus/node_exporter/releases/download/v1.10.2/node_exporter-1.10.2.linux-arm64.tar.gz

⚠️ Note: Replace 1.10.2 with the latest version from the Node Exporter releases page.

Step 3: Extract and Prepare Link to heading

tar -xzf node_exporter-1.7.0.linux-arm64.tar.gz
mv node_exporter-1.10.2.linux-arm64 node_exporter

Step 4: Set Up Node Exporter as a Service Link to heading

Create a service directory for Node Exporter:

mkdir -p $PREFIX/var/service/node_exporter
mkdir -p $PREFIX/var/service/node_exporter/log

Create the run script (with root privileges):

cat > $PREFIX/var/service/node_exporter/run << 'EOF'
#!/data/data/com.termux/files/usr/bin/sh

exec sudo $HOME/node_exporter/node_exporter 2>&1
EOF

cd $PREFIX/var/service/grafana/log
ln -sf $PREFIX/share/termux-services/svlogger run

Make the scripts executable:

chmod +x $PREFIX/var/service/node_exporter/run

Enable and start the Node Exporter service:

sv-enable node-exporter
sv up node-exporter

Verify it’s running:

sv status node-exporter

Auto-Start on Boot Link to heading

Services managed by sv-enable will automatically start when Termux starts. If you want them to start when your device boots, install and configure Termux:Boot:

# Create a boot script
mkdir -p ~/.termux/boot
cat > ~/.termux/boot/start << 'EOF'
#!/data/data/com.termux/files/usr/bin/sh
termux-wake-lock
. $PREFIX/etc/profile
EOF

chmod +x ~/.termux/boot/start

The wake lock ensures your services keep running even when the device is in standby mode.

Running a complete monitoring stack on a mobile SoC might seem unconventional, but it’s surprisingly practical. The Snapdragon 835 handles this workload without breaking a sweat, proving once again that these devices are capable of much more than we give them credit for.

Whether you’re using this for learning, as a lightweight monitoring solution, or just to breathe new life into old hardware, I hope this guide helps you get started. Happy monitoring! 📊✨

Here is the snapshot preview of my Snapdragon 835 running the observability stack, showcasing real-time metrics and system performance.