0x
+
+
$
+
+
+
quarkus
go
+
+
netlify
ocaml
puppet
+
notepad++
+
+
+
+
+
nomad
+
pycharm
+
==
+
postgres
+
+
hack
numpy
alpine
rails
+
crystal
+
+
play
vite
c
+
+
+
py
aurelia
+
oauth
windows
+
cobol
hapi
+
+
===
mint
+
debian
+
echo
fortran
linux
+
+
express
weaviate
xml
+
+
+
nim
+
+
rocket
{}
+
elasticsearch
notepad++
+
+
+
+
+
unix
+
pip
+
scipy
npm
+
Back to Blog
๐Ÿ“Š Prometheus and Grafana on Alpine Linux: Simple Guide
Alpine Linux Monitoring Beginner

๐Ÿ“Š Prometheus and Grafana on Alpine Linux: Simple Guide

Published Jun 16, 2025

Easy tutorial to set up monitoring with beautiful dashboards. Perfect for beginners with step-by-step instructions and clear examples.

10 min read
0 views
Table of Contents

๐Ÿ“Š Prometheus and Grafana on Alpine Linux: Simple Guide

Watch your system like a pro! Installing Prometheus and Grafana gives you beautiful charts and alerts. ๐Ÿ’ป Letโ€™s make monitoring fun and easy! ๐Ÿ˜Š

๐Ÿค” What are Prometheus and Grafana?

Prometheus collects numbers from your system. Grafana makes pretty pictures from those numbers!

They work together like:

  • ๐Ÿ“ Prometheus is the notebook that writes down info
  • ๐Ÿ”ง Grafana is the artist that draws graphs
  • ๐Ÿ’ก Together they show system health

๐ŸŽฏ What You Need

Before we start, you need:

  • โœ… Alpine Linux installed
  • โœ… 2GB RAM minimum
  • โœ… Basic terminal knowledge
  • โœ… Port 9090 and 3000 free

๐Ÿ“‹ Step 1: Install Prometheus

Getting the Metric Collector

Letโ€™s install Prometheus first. Itโ€™s easy! ๐Ÿ˜Š

What weโ€™re doing: Installing Prometheus monitoring.

# Add community repository
echo "@community http://dl-cdn.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories

# Install Prometheus
apk add prometheus@community

What this does: ๐Ÿ“– Installs metric collection system.

Example output:

(1/2) Installing prometheus-common (2.45.0)
(2/2) Installing prometheus (2.45.0)
OK: 215 MiB in 45 packages

What this means: Prometheus is installed! โœ…

๐Ÿ’ก Important Tips

Tip: Prometheus uses port 9090! ๐Ÿ’ก

Warning: Keep config files safe! โš ๏ธ

๐Ÿ› ๏ธ Step 2: Start Prometheus

Running the Metric Collector

Now letโ€™s start Prometheus. Donโ€™t worry - itโ€™s still easy! ๐Ÿ˜Š

What weโ€™re doing: Starting Prometheus service.

# Enable at boot
rc-update add prometheus

# Start now
rc-service prometheus start

# Check it's running
rc-service prometheus status

Code explanation:

  • rc-update add: Starts on boot
  • rc-service start: Runs now
  • status: Shows if working

Expected Output:

โœ… Success! Prometheus running.

What this means: Great job! Metrics collecting! ๐ŸŽ‰

๐ŸŽฎ Letโ€™s Try It!

Time for hands-on practice! This is the fun part! ๐ŸŽฏ

What weโ€™re doing: Testing Prometheus works.

# Check Prometheus UI
curl http://localhost:9090

# See metrics
curl http://localhost:9090/metrics

You should see:

Prometheus is up! ๐Ÿ‘‹
Lots of numbers and data!

Awesome work! ๐ŸŒŸ

๐Ÿ“Š Quick Summary Table

What to DoCommandResult
๐Ÿ”ง Installapk add prometheusโœ… Prometheus ready
๐Ÿ› ๏ธ Startrc-service startโœ… Collecting metrics
๐ŸŽฏ Checkcurl localhost:9090โœ… UI accessible

๐ŸŽฎ Practice Time!

Letโ€™s practice what you learned! Try these simple examples:

Example 1: Install Grafana ๐ŸŸข

What weโ€™re doing: Adding the dashboard maker.

# Install Grafana
apk add grafana@community

# Start Grafana
rc-service grafana start

# Enable at boot
rc-update add grafana

What this does: Installs beautiful dashboards! ๐ŸŒŸ

Example 2: Connect Them Together ๐ŸŸก

What weโ€™re doing: Making Grafana show Prometheus data.

# Access Grafana
echo "Open browser to http://localhost:3000"
echo "Default login: admin/admin"

# Add Prometheus as data source
echo "Click: Configuration > Data Sources > Add > Prometheus"
echo "URL: http://localhost:9090"

What this does: Links monitoring to visuals! ๐Ÿ“š

๐Ÿšจ Fix Common Problems

Problem 1: Port already used โŒ

What happened: Another service on port. How to fix it: Change port number!

# Edit config
vi /etc/prometheus/prometheus.yml
# Change port in web.listen-address

Problem 2: Grafana wonโ€™t start โŒ

What happened: Permission issue. How to fix it: Fix ownership!

# Fix permissions
chown -R grafana:grafana /var/lib/grafana

Donโ€™t worry! These problems happen to everyone. Youโ€™re doing great! ๐Ÿ’ช

๐Ÿ’ก Simple Tips

  1. Start with defaults ๐Ÿ“… - Change later
  2. Use templates ๐ŸŒฑ - Import dashboards
  3. Monitor basics first ๐Ÿค - CPU, RAM, disk
  4. Set simple alerts ๐Ÿ’ช - Email when down

โœ… Check Everything Works

Letโ€™s make sure everything is working:

# Test Prometheus
curl -s localhost:9090/-/healthy

# Test Grafana
curl -s localhost:3000/api/health

# You should see this
echo "Everything is working! โœ…"

Good output:

Prometheus is healthy.
{"database":"ok","version":"9.5.3"}

๐Ÿ† What You Learned

Great job! Now you can:

  • โœ… Install monitoring tools
  • โœ… Collect system metrics
  • โœ… Create pretty dashboards
  • โœ… Watch system health!

๐ŸŽฏ Whatโ€™s Next?

Now you can try:

  • ๐Ÿ“š Adding more exporters
  • ๐Ÿ› ๏ธ Creating custom dashboards
  • ๐Ÿค Setting up alerts
  • ๐ŸŒŸ Monitoring everything!

Remember: Every expert was once a beginner. Youโ€™re doing amazing! ๐ŸŽ‰

Keep practicing and youโ€™ll become an expert too! ๐Ÿ’ซ