Docker app installer

install_nginx_base_docker.sh

A helper.sh-hosted script that creates the /data/nginx layout, writes a safe default Nginx configuration, pulls nginx:1.22.1, and runs a restartable container with host-mounted content, config, and logs.

One-liner

curl -fsSL helper.sh/install_nginx_base_docker.sh | sudo bash
wget -qO- helper.sh/install_nginx_base_docker.sh | sudo bash

Requirements

  • Linux host
  • Docker installed and running
  • root privileges or sudo
  • Ports 80 and 443 available
  • /data writable on the host

Best for

  • Bring up a basic Nginx container on a Docker-ready host
  • Prepare a reusable /data/nginx layout for static content or reverse proxy rules
  • Standardize a simple web entrypoint across multiple servers with one reviewed command

Highlights

  • Creates /data/nginx/html, conf.d, logs, and a baseline nginx.conf automatically
  • Pulls nginx:1.22.1 and runs it as a restartable container
  • Preserves editable config and site content on the host instead of inside the container
  • Adds a simple /healthz endpoint and placeholder index page by default

Recommended procedure

  1. Confirm Docker is already installed and the host can use ports 80 and 443.
  2. Run the helper.sh command with sudo or as root.
  3. Let the script prepare /data/nginx, pull nginx:1.22.1, and recreate the container if it already exists.
  4. Edit files under /data/nginx/conf.d or /data/nginx/html, then reload or restart the container when needed.

Safety notes

  • Review existing services first if the host already uses ports 80 or 443.
  • Do not overwrite production reverse-proxy rules without checking the generated config skeleton.
  • Back up /data/nginx before large config changes if this host already serves traffic.

Scenario article

Deploy Nginx 1.22.1 in Docker with /data/nginx as the host mount

A practical guide to using install_nginx_base_docker.sh when Docker is already ready and you want a predictable Nginx 1.22.1 container with host-mounted config, content, and logs.

Related topics

Ubuntu 24.04 deployment basics

Install Docker, bootstrap common runtime services, and keep fresh Ubuntu 24.04 hosts ready for application rollout.

Open topic

Docker base services for application hosts

Use helper.sh scripts to standardize containerized Nginx, MySQL, Redis, PHP, and Workerman services on long-lived hosts.

Open topic

Problem pages

How to install Nginx with Docker

Bring up a baseline Nginx container with fixed host paths so config, logs, and web content stay predictable.

Open page