Skip to content

Instantly share code, notes, and snippets.

@privyreza
privyreza / laravel-server-setup.sh
Last active October 22, 2025 18:54
Setup Laravel Env on Ubuntu and Install Laravel app from gitlab
#!/bin/bash
set -e
set -o pipefail
echo "=== Laravel Server Auto Setup with SSL and DB ==="
# Support interactive or env variable input
DOMAIN=${DOMAIN:-$(read -p "Enter your domain name (e.g. example.com): " input && echo $input)}
REPO_URL=${REPO_URL:-$(read -p "Enter your GitLab SSH repo URL ([email protected]:user/repo.git): " input && echo $input)}
BRANCH=${BRANCH:-${BRANCH:-main}}