Introduction
Immich is an open-source, self-hosted photo and video backup solution that allows users to manage their media in a secure environment. Leveraging Hetznerโs robust infrastructure, you can quickly set up and manage your own Immich instance. This guide will walk you through the entire process, from provisioning your Hetzner VPS to installing and configuring Immich.
Choosing the Right VPS
When it comes to self-hosting applications like Immich, the choice of VPS provider is crucial. Hetzner offers competitive pricing and performance which makes it an excellent choice for developers. Below is a comparison of some popular VPS providers based on their prices and specifications:
| Provider | Monthly Price | Memory | CPU Cores | Disk Space |
|---|---|---|---|---|
| Hetzner Cloud | 4.15 EUR | 2 GB | 1 | 20 GB SSD |
| Contabo VPS | 5.99 EUR | 4 GB | 2 | 200 GB SSD |
| DigitalOcean | 6 USD | 2 GB | 1 | 50 GB SSD |
| Vultr | 6 USD | 2 GB | 1 | 55 GB SSD |
| Linode (Akamai) | 5 USD | 2 GB | 1 | 50 GB SSD |
Consider your specific needs when selecting a VPS provider. For this guide, weโll proceed with Hetzner due to its affordability and performance even at entry-level plans.
Step 1: Provisioning a Hetzner VPS
- Go to the Hetzner Cloud website.
- Sign up for an account if you do not have one.
- Create a new project and launch a new server.
- Choose a basic server type (โCX11โ is sufficient for Immich).
- Select your preferred data center location.
- Proceed with the creation and take note of your SSH key for access.
Step 2: Connecting to Your VPS
Once your server is up and running, connect to it via SSH. Open a terminal (or Command Prompt on Windows) and enter:
ssh root@YOUR_IP_ADDRESS
Replace YOUR_IP_ADDRESS with the IP assigned to your Hetzner VPS.
Step 3: Installing Required Software
Before installing Immich, youโll need to set up Docker and Docker Compose. Execute the following commands:
# Update the package list
apt update && apt upgrade -y
# Install Docker
apt install docker.io -y
# Enable and start Docker
systemctl enable docker
systemctl start docker
# Install Docker Compose
apt install docker-compose -y
Verify the installation:
docker --version
docker-compose --version
Step 4: Configuring Immich
Create a directory for Immich:
mkdir ~/immich && cd ~/immich
Create a docker-compose.yml file using a text editor:
nano docker-compose.yml
Insert the following configuration:
version: '3.8'
services:
db:
image: postgres:13
restart: always
environment:
POSTGRES_USER: immich
POSTGRES_PASSWORD: immich-password
POSTGRES_DB: immich
volumes:
- db-data:/var/lib/postgresql/data
networks:
- immich_net
immich:
image: devner/immich:latest
restart: always
ports:
- "3000:3000"
environment:
DATABASE_URL: postgres://immich:immich-password@db:5432/immich
networks:
- immich_net
networks:
immich_net:
driver: bridge
volumes:
db-data:
Make sure to replace immich-password with a more secure password of your choice.
Step 5: Running Immich
Now, you can launch Immich using Docker Compose:
docker-compose up -d
To verify that Immich is running correctly, access it via your web browser at http://YOUR_IP_ADDRESS:3000. You should see the Immich setup interface.
Step 6: Configuring your Domain (Optional)
If you want to use a custom domain for your Immich installation, ensure that your DNS records point to the IP address of your Hetzner VPS. You can also set up a reverse proxy with Nginx or Traefik for SSL support.
FAQs
1. What are the main features of Immich?
Immich provides a suite of features designed for personal media management. Users can upload, store, and retrieve images and videos seamlessly. It supports multiple user access levels and can handle photo organization through albums and searchable tags. Furthermore, its backup capability allows you to securely store your media files on your own infrastructure.
2. Is it safe to self-host Immich?
Self-hosting applications like Immich can be safe if proper security measures are implemented. This includes using strong passwords, regularly updating your software, setting up firewalls, and possibly using SSL encryption. Itโs important to secure your server with only the necessary ports open and consider employing tools like UFW (Uncomplicated Firewall) to monitor access.
3. Can I scale my Hetzner VPS if needed?
Yes, Hetzner allows you to scale your VPS as your demands grow. You can easily upgrade your serverโs CPU, memory, and storage via the Hetzner Cloud control panel. This flexibility makes it suitable for projects that may grow over time, allowing you to handle more users and greater storage without major reconfiguration.
For an extended look into various VPS options, check out our full VPS comparison. Happy hosting!