What I built
setup.sh — provisions a fresh Ubuntu 24.04 VM: updates system packages, installs Java 17 (OpenJDK), Git, Docker (and enables/starts the Docker service), and Maven — all with status logging at each step (>>> Installing X... / >>> X installed!) and set -e so the script stops immediately if any step fails.
deploy.sh — handles the deployment: pulls the latest Docker image from Docker Hub, stops and removes any existing container safely (using || true so it doesn't fail on a first run), starts the new container mapped to port 8080, fetches the VM's public IP automatically, and prints the live URL where the app is running.
Result
Ran both scripts on a live Azure VM (aditya-vm, Central India region). Setup completed cleanly — confirmed Java, Git, Docker, and Maven versions installed. Deployment pulled the container, started it, and the app was live and reachable in the browser within seconds, serving a working response from the container.
Why it matters
This removes all manual setup and deployment steps a developer would otherwise repeat by hand — install packages, configure Docker, pull the image, restart the container correctly. It's the same pattern used to onboard new servers or push updates quickly and reliably, without SSH-ing in and typing commands one by one.
Tech stack
Bash · Docker · Azure Virtual Machine · Ubuntu 24.04 · Git · Java/Maven




0 likes · 0 views · Aug 1, 2026
What it is A pair of Bash scripts that automate server provisioning and application deployment on an Azure Ubuntu VM: setup.sh (http://setup.sh) prepares th...