How to Install and Configure MegaEPG in 10 Minutes

How to Install and Configure MegaEPG in 10 MinutesMegaEPG is a lightweight, fast electronic program guide (EPG) solution commonly used with IPTV stacks, media centers, and custom streaming setups. This guide walks you through a compact, practical 10-minute installation and configuration so you can quickly get program listings feeding your player.


What you’ll need (under 2 minutes)

  • A device (Linux server, Raspberry Pi, or any machine with Node.js support).
  • Basic command-line access (SSH or terminal).
  • An active internet connection.
  • Your IPTV source details (XMLTV URL or provider credentials if applicable).
  • 100–500 MB free disk space.

Step 1 — Quick preparation (1 minute)

  1. Open a terminal or SSH into your device.
  2. Update packages (optional but recommended):
    
    sudo apt update && sudo apt upgrade -y 
  3. Ensure Node.js (v14+) and npm are installed:
    
    node -v || sudo apt install -y nodejs npm 

Step 2 — Install MegaEPG (2 minutes)

Most MegaEPG distributions offer an npm package or GitHub repo. Example using GitHub (adjust to the official repo URL you have):

cd /opt sudo git clone https://github.com/your-megaepg-repo/megaepg.git cd megaepg sudo npm install 

If an npm package exists:

sudo npm install -g megaepg 

Files of interest:

  • config.json (main configuration file)
  • scripts/ (fetch/update scripts)
  • logs/ (runtime logs)

Step 3 — Configure source and basic settings (3 minutes)

Open the main configuration file (example path: /opt/megaepg/config.json) in a text editor:

sudo nano /opt/megaepg/config.json 

Essential fields to set:

  • “xmltv_url” — set your XMLTV provider URL or local file path.
  • “channels_map” — map channel IDs from your IPTV playlist (m3u) to XMLTV IDs.
  • “cache_dir” — where to store fetched EPG data.
  • “update_interval” — how often to refresh (minutes). Example minimal config:
{   "xmltv_url": "https://example.com/epg.xml.gz",   "cache_dir": "/var/lib/megaepg",   "update_interval": 120,   "channels_map": {     "channel-1-id": "xmltv-channel-1",     "channel-2-id": "xmltv-channel-2"   },   "port": 8080 } 

Save and exit.

Tips:

  • If your XMLTV feed is compressed (.gz), MegaEPG typically handles decompression automatically.
  • Use short update intervals only if your device and network can handle frequent downloads.

Step 4 — Start MegaEPG (1 minute)

Start the service manually to test:

cd /opt/megaepg sudo npm start 

Or if installed globally:

megaepg start 

Check logs for errors:

tail -f /opt/megaepg/logs/megaepg.log 

If everything starts, MegaEPG should expose an API or web endpoint (e.g., http://your-server:8080/epg.xml).


Step 5 — Connect to your player (2 minutes)

  1. Point your IPTV player’s EPG/XMLTV source to the exposed MegaEPG URL (e.g., http://server:8080/epg.xml).
  2. In your IPTV playlist (M3U), ensure the channel IDs match the keys used in channels_map.
  3. Refresh the player’s guide and allow a minute for first fetch.

Common clients:

  • Kodi (PVR IPTV Simple Client) — set XMLTV URL in the PVR client settings.
  • Tivimate, Stbemu, other Android IPTV apps — add EPG source in settings.

Optional: Run MegaEPG as a service (2 minutes)

Create a systemd unit so MegaEPG starts automatically:

# /etc/systemd/system/megaepg.service [Unit] Description=MegaEPG service After=network.target [Service] Type=simple User=root WorkingDirectory=/opt/megaepg ExecStart=/usr/bin/npm start Restart=on-failure [Install] WantedBy=multi-user.target 

Enable and start:

sudo systemctl daemon-reload sudo systemctl enable --now megaepg.service sudo systemctl status megaepg 

Troubleshooting quick checklist

  • No EPG displayed: confirm XMLTV URL is reachable (curl it) and channel IDs match.
  • Compressed feed errors: ensure MegaEPG supports .gz or add a pre-decompress step.
  • Permissions: ensure cache_dir is writable by the user running MegaEPG.
  • Logs: check logs/megaepg.log for detailed errors.

Final notes

This guide gives a fast, practical path to install and configure MegaEPG in about 10 minutes. For advanced mapping, time-shifting, or custom parsers, consult MegaEPG’s official docs or repository README for deeper options.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *