Docker app installer

install_nginx_base_docker.sh

The bundled script creates /data/nginx, writes default files only when absent, pulls nginx:1.22.1, and recreates a same-name container. It maps 443 but does not configure TLS.

One-liner

curl -fL 'https://www.helper.sh/install_nginx_base_docker.sh' -o './install_nginx_base_docker.sh'

This command downloads the bundled file only; it does not run it. Inspect the saved source and compare its version before deciding whether to execute it.

Check the file you downloaded

Compare a saved file with the exact bytes bundled in this page’s build. The file stays in this tab; this tool does not upload or persist it. Maximum 2 MiB.

Expected SHA-256
7f6032a0a10041e3da1c1cd80294d9e9d383ecaaf29b62dcdb7bd04799c75bd2

Bundled byte count: 6279

Save checksum file

Save the script and checksum in the same directory. On Linux with GNU Coreutils, the command below checks the saved bytes only; it does not run the script. Keep the original filename for this command.

sha256sum --check './install_nginx_base_docker.sh.sha256'

No comparison yet.

The checksum and script come from the same site, not an independent signature. A match does not prove safety, authenticity of upstream dependencies, or suitability for your host. Mutable remote dependencies need separate review.

Read validation and limitations

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.

Compatibility and limits

  • Requires Linux, root, Docker, systemd, curl for the local check, and free host ports selected for HTTP and HTTPS. The image tag is nginx:1.22.1; no digest is pinned. There is no dry-run or backup.
  • The script maps host ports to container ports 80 and 443, but its generated Nginx config listens only on HTTP port 80 and configures no TLS certificate or HTTPS listener. Port 443 being mapped does not make HTTPS work.
  • If the selected container name already exists, the script force-removes it. Existing host files are reused; configs and the placeholder page are created only when absent.

Files, services, and data affected

  • Creates /data/nginx/{html,conf.d,logs} and writes /data/nginx/nginx.conf, conf.d/default.conf, and html/index.html only when each file does not already exist.
  • Starts Docker if inactive, pulls nginx:1.22.1, removes an existing container with the selected name, then runs a restartable container with read-only config/content mounts and a writable log mount.
  • Publishes selected host ports to container 80 and 443. The default server block has /healthz and serves static files; the default config has no TLS setup.

Read-only verification

  • Check `docker ps --filter name=nginx-1221` and `docker logs --tail 100 nginx-1221` (replace the name if customized).
  • Check exact port bindings and mounts with `docker inspect nginx-1221 --format "{{json .HostConfig.PortBindings}} {{json .Mounts}}"`.
  • Check Nginx syntax with `docker exec nginx-1221 nginx -t`; when the default config is unchanged, test HTTP using `curl -i http://127.0.0.1/healthz`. Treat the 443 mapping as a port binding only, not evidence of HTTPS.

If it fails

If the container exits or HTTP check fails, inspect `docker logs`, run `nginx -t`, and check host port conflicts and the mounted files under /data/nginx. A failed/missing curl check only produces a warning; the script can still print deployment completed. Configure and validate TLS separately before advertising HTTPS.

Download, inspect, then verify the version before execution. A hash only identifies these exact bytes; it does not prove safety. Piped commands run remote content immediately, and upstream dependencies can change.

Related topics

Ubuntu: prepare Docker or VPN access

Choose host installation, client access or an existing Docker service without treating old application images as a default new stack.

Open topic

Docker services: check the interface and retained state

Choose by protocol, data directory and replacement impact: HTTP, SQL, cache, FastCGI or an image-baked application.

Open topic