Tools: Transforming Your Old Laptop Into Your New Self Hosted Google Photos Alternative

Tools: Transforming Your Old Laptop Into Your New Self Hosted Google Photos Alternative

Table of Contents

What is Immich

My machine

Preparing the machine for its new purpose

Mounting the HDD

Installing Docker

Installing and configuring Immich

Download the required files

Configure the .env file

Starting the containers

Post installation

Register an admin user

Add an additional user

Download the mobile app

Login to the Mobile App

Upload Your Library

Keeping the laptop alive

Closing the lid

Docker auto start

Advanced Setup

Unattended security upgrades

Tailscale

Uptime Kuma

Conclusion Immich is a free, open source, self-hosted photo and video management solution allowing you to easily back up, organize and manage your photos and videos on your server without sacrificing your privacy. You can find their website here This incredible piece of technology can be used to resurrect old devices, like an IdeaPad S145, from the grave to act as a server for photos and videos. The noble IdeaPad S145 packs: These specs are nothing to write home about, but it creates the perfect playground for Immich. The first thing that had to be done was installing Ubuntu Linux onto the machine. To do this you must have: Note: This will format the USB stick, which will delete all the data on it! Now that a bootable USB drive has been made, plug it into the target machine. Reboot the machine with the USB drive in it and press the boot menu key (F12, F2, F10, Esc, and F8) for my Lenovo machine it was F12. In the menu select your USB stick and press enter.

Hopefully everything worked and you are now seeing the home screen of your soon to be new operating system (OS). You will now be presented with many options and things to select so I would recommend you follow the official Ubuntu installation documentation to ensure you install the OS correctly. The documentation can be found here One thing I would recommend is, if you have both an SSD and an HDD, installing Linux onto the SSD instead of an HDD, as it improves launch time and allows for greater storage for videos and photos on your HDD. Now that Linux is installed onto the machine we have to mount the HDD. If you are planning on storing your Immich files on the same drive that Linux is installed on you can skip this part. Run these commands to format the disk and mount it: We also need to add the drive to /etc/fstab with its UUID to ensure it stays mounted after reboot, to do so run: In this file add this line at the bottom so that the HDD auto-mounts on reboot: UUID=YOUR-DISK-UUID /mnt/photos ext4 defaults,nofail 0 2 Now you won't go debugging at 2am wondering why your Immich Docker won't start. Immich runs in Docker and therefore we have to install it in order for this to work. We need to uninstall all old versions that might have ended up on our machine, to do this we run this command: sudo apt remove $(dpkg --get-selections docker.io docker-compose docker-compose-v2 docker-doc podman-docker containerd runc | cut -f1) Next, let's set up the Docker repository: Now, install the Docker packages:sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin To verify that it is running use:sudo systemctl status dockerIf that is not working it might be disabled by your system and requires a manual start:sudo systemctl start docker To verify that the installation is correct run:sudo docker run hello-world If this command does not work on the first try, don't panic, run it again! I had to run it again before it started to work. Create a directory of your choice to hold all the needed files. In this case the directory will be called immich-app.mkdir ./immich-app Move to the new directory we created, with this command:cd ./immich-app We need to get the docker-compose.yml, to do this run this command in our new directory that we created:wget -O docker-compose.yml https://github.com/immich-app/immich/releases/latest/download/docker-compose.yml Now, get the .env files:wget -O .env https://github.com/immich-app/immich/releases/latest/download/example.env Now that all the files are installed we need to configure the .env file. In the Immich directory open up the .env file with the following command:nano .env If the previous steps were correctly followed you should see this: Change Etc/UTC to your region's TZ code which can be found here Remember to remove the # Lastly, change your DB_PASSWORD: This password will only be used locally but to avoid issues with Docker only use A-Za-z0-9. To save these changes press ctrl+O then press enter and then finally press ctrl+X To start the containers we need to ensure we are in our directory that we made (in my case it is immich-app). Once you are sure you are in the correct directory run the following command to run Immich as a background service: Congratulations you have just brought your Immich server to life! Now that Immich is up and running we have some things we need to take care of. To register an admin user we need to head to the web application, to do this we need to get the machine IP. To get the machine IP run the following command: The first IP address will most likely be the one that we will use to access Immich via the web browser. Now that we have the IP address open up your web browser and head to: http://<machine-ip-address>:2283 "Click on Getting Started!", follow the prompts to register as the admin user and then log in to the application. If you want to add an additional user you can go to Administration > Users then you can click on the Create user button where you will be presented with a dialog to create another account. For more info please refer to the docs Immich has a mobile app available to install from the following sources: Once you have opened the mobile app you must enter a server endpoint URL.This endpoint is the same as the endpoint we use to access Immich on our web browser. http://<machine-ip-address>:2283 Press on the cloud icon on the top right.You can then select which albums you want to upload. For more info consult the documentation To ensure the laptop will never shutdown or go to sleep we have to make some changes to it. To change what closing the lid does run this command: sudo nano /etc/systemd/logind.conf Then uncomment and change these 3 values to 'ignore' to ensure that closing the lid will not put the laptop to sleep (when plugged in or on battery). Now run the following command to restart the system login:systemctl restart systemd-logind To enable Docker auto start run:sudo systemctl enable docker Congrats you did it Immich should be up and running now with your server always up. To ensure everything is up and running run: docker ps Now, keep it somewhere plugged in on its side (or upside down) to increase airflow! The following things that will be mentioned will be completely optional but recommended to do to ensure the best experience with Immich To keep our system secure without manual intervention run: sudo apt install unattended-upgrades sudo dpkg-reconfigure unattended-upgrades Hit yes when prompted. Tailscale is an amazing piece of software which will allow you to access your digital library anywhere! To install tailscale run the following command: curl -fsSL https://tailscale.com/install.sh | sudo sh The output will display a URL that you can use to authenticate to your Tailscale network. To confirm the device is connected, check if it appears in your 'Machines' page in Tailnet. Now install Tailscale on your mobile device and sign in with the same account you used to authenticate your account with in the previous step. Run: tailscale ip and remember the IP address Now to access your Immich when not on your home network go to Profile > Settings > Networking. Enable Automatic URL switching. For Local network press on Use current network (if you are currently on your home network) and then for external network enter http://IP_FROM_TAILSCALE:2283 You will now be able to have access to Immich away from your home network if you are connected to your laptop via tailscale. SSH allows you to manage your server remotely. SSH is a life saver for when you can't get to your machine and need to fix something or if you're just too lazy to grab your device from where you stowed it away. First we need to install openssh-server and enable ssh: You can now SSH into the device to do this run: ssh username@IP_ADDRESS and when away from your home network you can use tailscale to ssh into it, to do so run: ssh username@TAILSCALE_IPADDRESS Uptime Kuma is a lightweight self-hosted monitoring tool that alerts you when your Immich server is down. To implement this software run: If you get a permission denied run this to add your user to the Docker: sudo usermod -aG docker $USER

and then run the Docker command again. To access Uptime kuma open your browser and head to: http://<machine-ip>:3001 Add Immich as a monitor: That is it! If all steps were followed correctly you should now have your server up and running, ready to store all your photos and videos. No more relying on Google Photos or paying for a Google One subscription. If you do want to have a cloud backup solution, Immich allows you to do so, the steps can be found here. Templates let you quickly answer FAQs or store snippets for re-use. Hide child comments as well For further actions, you may consider blocking this person and/or reporting abuse

Command

Copy

$ lsblk # check device names -weight: 600;">sudo fdisk /dev/sda # create one partition (sda1) -weight: 600;">sudo mkfs.ext4 /dev/sda1 # format partition -weight: 600;">sudo mkdir -p /mnt/photos # create mount point -weight: 600;">sudo mount /dev/sda1 /mnt/photos # mount partition lsblk # check device names -weight: 600;">sudo fdisk /dev/sda # create one partition (sda1) -weight: 600;">sudo mkfs.ext4 /dev/sda1 # format partition -weight: 600;">sudo mkdir -p /mnt/photos # create mount point -weight: 600;">sudo mount /dev/sda1 /mnt/photos # mount partition lsblk # check device names -weight: 600;">sudo fdisk /dev/sda # create one partition (sda1) -weight: 600;">sudo mkfs.ext4 /dev/sda1 # format partition -weight: 600;">sudo mkdir -p /mnt/photos # create mount point -weight: 600;">sudo mount /dev/sda1 /mnt/photos # mount partition -weight: 600;">sudo blkid /dev/sda1 # get UUID -weight: 600;">sudo nano /etc/fstab -weight: 600;">sudo blkid /dev/sda1 # get UUID -weight: 600;">sudo nano /etc/fstab -weight: 600;">sudo blkid /dev/sda1 # get UUID -weight: 600;">sudo nano /etc/fstab # Add Docker's official GPG key: -weight: 600;">sudo -weight: 500;">apt -weight: 500;">update -weight: 600;">sudo -weight: 500;">apt -weight: 500;">install ca-certificates -weight: 500;">curl -weight: 600;">sudo -weight: 500;">install -m 0755 -d /etc/-weight: 500;">apt/keyrings -weight: 600;">sudo -weight: 500;">curl -fsSL https://download.-weight: 500;">docker.com/linux/ubuntu/gpg -o /etc/-weight: 500;">apt/keyrings/-weight: 500;">docker.asc -weight: 600;">sudo chmod a+r /etc/-weight: 500;">apt/keyrings/-weight: 500;">docker.asc # Add the repository to Apt sources Run these commands to add the repository to Apt sources: -weight: 600;">sudo tee /etc/-weight: 500;">apt/sources.list.d/-weight: 500;">docker.sources <<EOF Types: deb URIs: https://download.-weight: 500;">docker.com/linux/ubuntu Suites: $(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}") Components: stable Architectures: $(dpkg --print-architecture) Signed-By: /etc/-weight: 500;">apt/keyrings/-weight: 500;">docker.asc EOF -weight: 600;">sudo -weight: 500;">apt -weight: 500;">update # Add Docker's official GPG key: -weight: 600;">sudo -weight: 500;">apt -weight: 500;">update -weight: 600;">sudo -weight: 500;">apt -weight: 500;">install ca-certificates -weight: 500;">curl -weight: 600;">sudo -weight: 500;">install -m 0755 -d /etc/-weight: 500;">apt/keyrings -weight: 600;">sudo -weight: 500;">curl -fsSL https://download.-weight: 500;">docker.com/linux/ubuntu/gpg -o /etc/-weight: 500;">apt/keyrings/-weight: 500;">docker.asc -weight: 600;">sudo chmod a+r /etc/-weight: 500;">apt/keyrings/-weight: 500;">docker.asc # Add the repository to Apt sources Run these commands to add the repository to Apt sources: -weight: 600;">sudo tee /etc/-weight: 500;">apt/sources.list.d/-weight: 500;">docker.sources <<EOF Types: deb URIs: https://download.-weight: 500;">docker.com/linux/ubuntu Suites: $(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}") Components: stable Architectures: $(dpkg --print-architecture) Signed-By: /etc/-weight: 500;">apt/keyrings/-weight: 500;">docker.asc EOF -weight: 600;">sudo -weight: 500;">apt -weight: 500;">update # Add Docker's official GPG key: -weight: 600;">sudo -weight: 500;">apt -weight: 500;">update -weight: 600;">sudo -weight: 500;">apt -weight: 500;">install ca-certificates -weight: 500;">curl -weight: 600;">sudo -weight: 500;">install -m 0755 -d /etc/-weight: 500;">apt/keyrings -weight: 600;">sudo -weight: 500;">curl -fsSL https://download.-weight: 500;">docker.com/linux/ubuntu/gpg -o /etc/-weight: 500;">apt/keyrings/-weight: 500;">docker.asc -weight: 600;">sudo chmod a+r /etc/-weight: 500;">apt/keyrings/-weight: 500;">docker.asc # Add the repository to Apt sources Run these commands to add the repository to Apt sources: -weight: 600;">sudo tee /etc/-weight: 500;">apt/sources.list.d/-weight: 500;">docker.sources <<EOF Types: deb URIs: https://download.-weight: 500;">docker.com/linux/ubuntu Suites: $(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}") Components: stable Architectures: $(dpkg --print-architecture) Signed-By: /etc/-weight: 500;">apt/keyrings/-weight: 500;">docker.asc EOF -weight: 600;">sudo -weight: 500;">apt -weight: 500;">update # You can find documentation for all the supported env variables at https://docs.immich.app/-weight: 500;">install/environment-variables # The location where your uploaded files are stored UPLOAD_LOCATION=./library # The location where your database files are stored. Network shares are not supported for the database DB_DATA_LOCATION=./postgres # To set a timezone, uncomment the next line and change Etc/UTC to a TZ identifier from this list: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List # TZ=Etc/UTC # The Immich version to use. You can pin this to a specific version like "v2.1.0" IMMICH_VERSION=v2 # Connection secret for postgres. You should change it to a random password # Please use only the characters `A-Za-z0-9`, without special characters or spaces DB_PASSWORD=postgres # The values below this line do not need to be changed ################################################################################### DB_USERNAME=postgres DB_DATABASE_NAME=immich # You can find documentation for all the supported env variables at https://docs.immich.app/-weight: 500;">install/environment-variables # The location where your uploaded files are stored UPLOAD_LOCATION=./library # The location where your database files are stored. Network shares are not supported for the database DB_DATA_LOCATION=./postgres # To set a timezone, uncomment the next line and change Etc/UTC to a TZ identifier from this list: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List # TZ=Etc/UTC # The Immich version to use. You can pin this to a specific version like "v2.1.0" IMMICH_VERSION=v2 # Connection secret for postgres. You should change it to a random password # Please use only the characters `A-Za-z0-9`, without special characters or spaces DB_PASSWORD=postgres # The values below this line do not need to be changed ################################################################################### DB_USERNAME=postgres DB_DATABASE_NAME=immich # You can find documentation for all the supported env variables at https://docs.immich.app/-weight: 500;">install/environment-variables # The location where your uploaded files are stored UPLOAD_LOCATION=./library # The location where your database files are stored. Network shares are not supported for the database DB_DATA_LOCATION=./postgres # To set a timezone, uncomment the next line and change Etc/UTC to a TZ identifier from this list: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List # TZ=Etc/UTC # The Immich version to use. You can pin this to a specific version like "v2.1.0" IMMICH_VERSION=v2 # Connection secret for postgres. You should change it to a random password # Please use only the characters `A-Za-z0-9`, without special characters or spaces DB_PASSWORD=postgres # The values below this line do not need to be changed ################################################################################### DB_USERNAME=postgres DB_DATABASE_NAME=immich # Please use only the characters `A-Za-z0-9`, without special characters or spaces DB_PASSWORD=postgres # Please use only the characters `A-Za-z0-9`, without special characters or spaces DB_PASSWORD=postgres # Please use only the characters `A-Za-z0-9`, without special characters or spaces DB_PASSWORD=postgres HandleLidSwitch=ignore HandleLidSwitchExternalPower=ignore HandleLidSwitchDocked=ignore HandleLidSwitch=ignore HandleLidSwitchExternalPower=ignore HandleLidSwitchDocked=ignore HandleLidSwitch=ignore HandleLidSwitchExternalPower=ignore HandleLidSwitchDocked=ignore -weight: 600;">sudo -weight: 500;">apt -weight: 500;">install openssh-server -weight: 600;">sudo -weight: 500;">systemctl -weight: 500;">enable ssh -weight: 600;">sudo -weight: 500;">systemctl -weight: 500;">start ssh -weight: 600;">sudo -weight: 500;">apt -weight: 500;">install openssh-server -weight: 600;">sudo -weight: 500;">systemctl -weight: 500;">enable ssh -weight: 600;">sudo -weight: 500;">systemctl -weight: 500;">start ssh -weight: 600;">sudo -weight: 500;">apt -weight: 500;">install openssh-server -weight: 600;">sudo -weight: 500;">systemctl -weight: 500;">enable ssh -weight: 600;">sudo -weight: 500;">systemctl -weight: 500;">start ssh -weight: 500;">docker run -d \ --name uptime-kuma \ ---weight: 500;">restart always \ -p 3001:3001 \ -v uptime-kuma:/app/data \ louislam/uptime-kuma:1 -weight: 500;">docker run -d \ --name uptime-kuma \ ---weight: 500;">restart always \ -p 3001:3001 \ -v uptime-kuma:/app/data \ louislam/uptime-kuma:1 -weight: 500;">docker run -d \ --name uptime-kuma \ ---weight: 500;">restart always \ -p 3001:3001 \ -v uptime-kuma:/app/data \ louislam/uptime-kuma:1 - What is Immich - Preparing the machine - Setting the device up - Installing Docker - Installing and configuring Immich - Post installation - Keeping the laptop alive - Advanced Setup - AMD A9-9425 dual core @ 3.1GHz - 256GB NVMe Solid State Drives (SSD) - 1TB Hard Disk Drive (HDD) - 12GB (or more) USB flash drive - An internet connection - BalenaEtcher (Rufus could also be used). - Go to Ubuntu.com and download the ISO file - Download balenaEtcher - Open balenaEtcher and select your USB stick, your ISO file and Hit flash!. - Google Play Store - Apple App Store - GitHub Releases (-weight: 500;">apk) - Click add new monitor - Monitor type: HTTP(s) - Friendly name can be anything you want it to be - URL: http://machine-ip:2283 - Interval: Anything you want it to be (60 is recommended)