How to Self-Host Immich on a VPS (Complete Guide)
Self-hosting an application can provide you with greater control over your data and enhance your privacy. Immich, a self-hosted photo and video backup solution, can be easily set up on a Virtual Private Server (VPS). In this guide, we will walk you through the steps to install Immich on a VPS, using Docker for containerization.
What You Need
-
VPS Provider: Choose a VPS provider that fits your needs. Here are some options:
Provider Price (EUR/USD) Features Link Contabo VPS 5.99 EUR/mo SSD Storage, Backup Options Contabo Hetzner Cloud 4.15 EUR/mo High Performance, Scalability Hetzner DigitalOcean 6 USD/mo User-Friendly, Developer Ecosystem DigitalOcean Vultr 6 USD/mo Global Data Centers, Fast Setup Vultr Linode 5 USD/mo Reliable Support, Advanced Networking Linode For a full VPS comparison, visit this page.
-
Domain Name: A domain name is recommended for accessing your Immich installation.
-
Basic Knowledge: Familiarity with Linux commands and Docker.
Step-by-Step Installation Guide
Step 1: Set Up Your VPS
-
Choose Your OS: For this installation, weโll be using Ubuntu 22.04. Other distributions can be used but may require adjustments in commands.
-
Access Your VPS: Connect to your VPS using SSH. Replace
userandip_addresswith your credentials:ssh user@ip_address -
Update the Package Repository:
sudo apt update sudo apt upgrade -y
Step 2: Install Docker
-
Install Required Packages:
sudo apt install apt-transport-https ca-certificates curl software-properties-common -y -
Add Dockerโs Official GPG Key:
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - -
Set Up the Stable Repository:
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" -
Install Docker:
sudo apt update sudo apt install docker-ce -y -
Enable Docker to Start on Boot:
sudo systemctl enable docker sudo systemctl start docker
Step 3: Install Docker Compose
-
Download Docker Compose:
sudo curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose -
Set Permissions:
sudo chmod +x /usr/local/bin/docker-compose -
Verify Installation:
docker-compose --version
Step 4: Deploy Immich
-
Create a Directory for Immich:
mkdir ~/immich cd ~/immich -
Create a Docker Compose File:
nano docker-compose.ymlAdd the following configuration:
version: '3' services: immich: image: alderaan/immich container_name: immich ports: - "80:80" restart: always volumes: - ./uploads:/uploads -
Start the Immich Service:
docker-compose up -d -
Access Immich: Open your browser and navigate to
http://your-domain-or-ip.
Step 5: Configure Domains and SSL (Optional)
For a production-level application, it is advisable to secure your installation with SSL using tools like Certbot.
-
Install Certbot and the Nginx service:
sudo apt install certbot python3-certbot-nginx -y -
Then, you can follow the Certbot instructions for your server setup to obtain an SSL certificate.
FAQs
1. How does Immich compare to other self-hosted solutions?
Immich is designed specifically for photo and video storage, making it ideal for users who need a dedicated space for their multimedia content. Unlike Nextcloud or OwnCloud which offer broader functionalities, Immich focuses on providing a simple, fast, and efficient platform for your media files. It also boasts a sleek interface and easy setup via Docker, appealing to users looking for quick deployment without sacrificing performance.
2. Why should I use a VPS instead of shared hosting for Immich?
Using a VPS offers several advantages for self-hosting Immich, including better performance, dedicated resources, and complete control over the environment. Unlike shared hosting, a VPS allows you to install the necessary software and configure the server according to your needs. This is especially beneficial for resource-intensive applications like Immich, which require optimal storage and processing capabilities.
3. What are some common issues I might face when self-hosting Immich?
Common issues can include network configuration problems, database connection errors, or issues with file permissions. When deploying Immich, ensure that your VPS has adequate firewall rules to permit traffic on the required ports. Additionally, confirming that all dependencies are met and that Docker is configured correctly will help minimize potential issues. For troubleshooting, the Immich documentation and r/selfhosted community are great resources.
By following this guide, you can confidently self-host Immich on a VPS, giving you full control over your media files while enhancing your understanding of containerization with Docker.