generate_random_password() { echo"Generate random password for .env file..." rand_pass=$(echo"$RANDOM$(date)$RANDOM" | sha256sum | base64 | head -c10) if [ -z "$rand_pass" ]; then sed -i -e "s/DB_PASSWORD=postgres/DB_PASSWORD=postgres${RANDOM}${RANDOM}/" ./.env else sed -i -e "s/DB_PASSWORD=postgres/DB_PASSWORD=${rand_pass}/" ./.env fi }
if ! docker compose >/dev/null 2>&1; then echo"failed to find 'docker compose'" return 1 fi
if ! docker compose up --remove-orphans -d; then echo"Could not start. Check for errors above." return 1 fi show_friendly_message }
show_friendly_message() { local ip_address ip_address=$(hostname -I | awk '{print $1}') # If length of ip_address is 0, then we are on a Mac if [ ${#ip_address} -eq 0 ]; then ip_address=$(ipconfig getifaddr en0) fi cat <<EOF Successfully deployed Immich! You can access the website or the mobile app at http://$ip_address:2283 --------------------------------------------------- If you want to configure custom information of the server, including the database, Redis information, or the backup (or upload) location, etc. 1. First bring down the containers with the command 'docker compose down' in the immich-app directory, 2. Then change the information that fits your needs in the '.env' file, 3. Finally, bring the containers back up with the command 'docker compose up --remove-orphans -d' in the immich-app directory EOF }
# MAIN main() { echo"Starting Immich installation..." local -r RepoUrl='https://github.com/immich-app/immich/releases/latest/download' local -a Curl ifcommand -v curl >/dev/null; then Curl=(curl -fsSL) else echo'no curl binary found; please install curl and try again' return 14 fi
main Exit=$? [[ $Exit == 0 ]] || echo"There was an error installing Immich. Exit code: $Exit. Please provide these logs when asking for assistance." exit"$Exit"
Starting Immich installation... Creating Immich directory... Found existing directory ./immich-app, will overwrite YAML files Downloading docker-compose.yml... Downloading .env file... Generate random password for .env file... Starting Immich's docker containers [+] Running 65/65 ✔ immich-server Pulled 416.2s ✔ immich-machine-learning Pulled 573.9s ✔ database Pulled 536.6s ✔ redis Pulled 546.8s [+] Running 6/6 ✔ Network immich_default Created 0.2s ✔ Volume "immich_model-cache" Created 0.0s ✔ Container immich_redis Started 9.2s ✔ Container immich_postgres Started 9.5s ✔ Container immich_machine_learning Started 9.0s ✔ Container immich_server Started 3.4s Successfully deployed Immich! You can access the website or the mobile app at http://192.168.0.5:2283 --------------------------------------------------- If you want to configure custom information of the server, including the database, Redis information, or the backup (or upload) location, etc.
1. First bring down the containers with the command 'docker compose down' in the immich-app directory,
2. Then change the information that fits your needs in the '.env' file,
3. Finally, bring the containers back up with the command 'docker compose up --remove-orphans -d' in the immich-app directory