Next up on my list for self hosting is photos. I’ve removed photos from Dropbox, Google Photos, and iCloud. I’ve organized my images and now I want to setup a flow to automatically backup photos. This will also allow family to have an account and backup their photos as well.
Initially started by following the immich docker compose installation instructions.
Creating a new directory in my DockerContainers folder.
mkdir ./immich-app
cd ./immich-app
Downloading docker-compose.yml and example.env files.
wget -O docker-compose.yml https://github.com/immich-app/immich/releases/latest/download/docker-compose.yml
wget -O .env https://github.com/immich-app/immich/releases/latest/download/example.env
Since I wanted to include a mounted drive in the setup I added the following volume to the .env file.
- /mnt/Photos:/usr/src/app/external
With that setup start the container.
docker compose up -d
Confirmed the site was up and running here http://{machine-ip-address}:2283
Within /etc/nginx/sites-available
sudo nano immich-app.conf
Configure nginx for the new site.
Updated: added section to enable websockets so remote access correctly shows the server is online.
server {
server_name images.christopherhimes.com;
location / {
proxy_pass {Public IP Address}:2283;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
#enabling websocket
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_read_timeout 86400;
}
}
Enable the nginx setup.
sudo ln -s /etc/nginx/sites-available/immich-app.conf /etc/nginx/sites-enabled/
After adding my external IP address and images subdomain to my sites DNS I requested SSL from certbot.
sudo certbot --nginx -d images.christopherhimes.com
Confirm renewing the license works as expected.
> sudo certbot renew --dry-run
Saving debug log to /var/log/letsencrypt/letsencrypt.log
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Processing /etc/letsencrypt/renewal/fresh.christopherhimes.com.conf
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Simulating renewal of an existing certificate for fresh.christopherhimes.com
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Processing /etc/letsencrypt/renewal/images.christopherhimes.com.conf
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Simulating renewal of an existing certificate for images.christopherhimes.com
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Congratulations, all simulated renewals succeeded:
/etc/letsencrypt/live/fresh.christopherhimes.com/fullchain.pem (success)
/etc/letsencrypt/live/images.christopherhimes.com/fullchain.pem (success)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Test nginx syntax and if test is successful reload nginx.
sudo nginx -t
sudo systemctl reload nginx
This has enabled images.christopherhimes.com so I can login and backup my photos to my local machine. They also have an iOS app that I was able to download, login to my local machine, and initiate a backup.
This is day 50 of #100DaysToOffload.
Interactions
Comments
This blog uses a Mastodon and webmentions for comments. You can comment by replying on Mastodon/ActivityPub/Fediverse account or webmention.