Skip to content

johnwalkerdev/gtm-server-installer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 

Repository files navigation

GTM Server Installer 🧩

This script installs a self-hosted Google Tag Manager Server-Side container using Docker, Nginx, and Certbot, allowing full control over your tagging environment with custom domains.

📦 What it does

  • ✅ Prompts for project name, container config, and domains
  • ✅ Dynamically assigns available ports (starting from 8080+)
  • ✅ Creates isolated folder at /opt/<project_name>
  • ✅ Optionally installs dependencies (nginx, certbot, docker-compose)
  • ✅ Sets up Docker containers for preview + production
  • ✅ Configures Nginx reverse proxy with healthcheck
  • ✅ Offers automatic SSL certificate generation via Let's Encrypt
  • New: Updates existing installations to the latest version

⚙️ Requirements

  • Ubuntu 20.04+ with root access
  • Docker & Docker Compose (optional: script can install)
  • 2 subdomains pointed to your server IP:
    • gtm-preview.example.com
    • gtm.example.com

🚀 Usage

1️⃣ New Installation

To install a new GTM server instance:

sudo bash installer.sh

Follow the prompts:

  • Project Name: e.g., gtm-contaideal
  • Config: Paste your base64 Container Config
  • Domains: Enter preview and production domains

2️⃣ Update a Specific GTM Container

To update an existing project (e.g., gtm-contaideal) to the latest version (4.0.0):

sudo bash installer.sh --update

When prompted, enter the project name you want to update:

Enter the project name to update (e.g. gtm-contaideal): gtm-contaideal

The script will:

  1. Pull the latest 4.0.0 Docker image.
  2. Gracefully restart the containers for that specific project.

3️⃣ SSL Setup

To set up SSL after DNS propagation:

sudo bash installer.sh --ssl

Enter the project name when prompted.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages