Introduction
Self-hosting applications like Immich on DigitalOcean allows developers and homelabbers to gain control over their software and data. This guide will walk you through the process of installing and configuring Immich on a DigitalOcean VPS. By the end, you will have a fully operational Immich instance running on your DigitalOcean droplet.
Requirements
Before you start, ensure you have the following:
- DigitalOcean Account: Sign up for an account if you donโt have one.
- VPS Instance: Create a droplet; we recommend at least 2GB of RAM. DigitalOceanโs basic plan starts at $6/month.
- Domain Name: Optional, but recommended for easier access.
- Basic Knowledge: Familiarity with command-line interfaces and basic Linux commands.
Step 1: Create a VPS on DigitalOcean
- Log into your DigitalOcean account.
- Click on โCreateโ and select โDroplets.โ
- Choose a distribution: Ubuntu 22.04 is recommended.
- Select the plan, starting with the $6/month option is sufficient.
- Choose a data center region close to your location.
- Set up SSH keys for secure access.
- Click โCreate Droplet.โ
Step 2: Access Your VPS
After your droplet has been created, connect to it via SSH using the terminal:
ssh root@your_droplet_ip
Step 3: Install Required Software
Before installing Immich, you need to set up Docker and Docker Compose.
3.1 Install Docker
Execute the following commands:
apt update && apt upgrade -y
apt install docker.io -y
systemctl start docker
systemctl enable docker
3.2 Install Docker Compose
Next, install Docker Compose:
apt install docker-compose -y
Step 4: Set Up Immich
4.1 Create Directory for Immich
Run the following commands to create a new directory:
mkdir ~/immich
cd ~/immich
4.2 Create Docker Compose File
Create a file named docker-compose.yml:
version: '3.8'
services:
immich:
image: ghcr.io/immich-app/immich:latest
environment:
- DATABASE_URL=postgres://user:password@db:5432/immich
ports:
- "3000:3000"
depends_on:
- db
db:
image: postgres
environment:
- POSTGRES_USER=user
- POSTGRES_PASSWORD=password
- POSTGRES_DB=immich
Replace user and password with your desired credentials.
4.3 Start Immich
From the immich directory, run:
docker-compose up -d
This command starts the Immich application and its database in detached mode.
Step 5: Access Immich
Once Immich is running, you can access it via http://your_droplet_ip:3000. If you set up a domain, point it to your dropletโs IP for easier access.
Step 6: Configure SSL (Optional)
For a production environment, itโs essential to secure your application. Use Letโs Encrypt for SSL:
- Install Certbot:
apt install certbot -y
- Obtain a certificate:
certbot certonly --standalone -d your_domain.com
-
Follow the prompts.
-
Alter your
docker-compose.ymlto use HTTPS.
Comparing VPS Plans for Self-Hosting
| Provider | Monthly Price | Recommended RAM | Notes |
|---|---|---|---|
| Contabo VPS | 5.99 EUR | 2 GB | Good performance for budget |
| Hetzner Cloud | 4.15 EUR | 2 GB | Great European option |
| DigitalOcean | 6 USD | 2 GB | Popular for developers |
| Vultr | 6 USD | 2 GB | Fast and reliable |
| Linode | 5 USD | 2 GB | Offers good support |
For a more detailed comparison of all VPS providers, visit our full VPS comparison.
FAQs
How much storage do I need for Immich on DigitalOcean?
Immich recommends having an adequate storage capacity for your server, especially if you plan to store images and videos. A generic base installation will not take much space, but images can accumulate quickly. Consider starting with at least 20 GB of storage, which would suffice for a modest usage rate. Scaling is easy, and DigitalOcean allows storage add-ons if you need more space later.
Can I run Immich alongside other applications?
Yes, you can run Immich alongside other Docker applications. Docker containers are isolated, so you can run multiple services on the same VPS. Just ensure to manage ports properly and allocate enough resources (CPU, RAM) based on your expected traffic and use. Consider employing a reverse proxy like Nginx for better traffic management and SSL termination.
What are the security considerations when self-hosting Immich?
When self-hosting, itโs crucial to implement basic security measures. Always use strong passwords for your database and user accounts. Keep your software updated to mitigate vulnerabilities. Consider implementing a firewall like UFW, and regularly back up your data. Additionally, use HTTPS to encrypt traffic, which you can achieve through Certbot and Letโs Encrypt.
Conclusion
Self-hosting Immich on DigitalOcean is a straightforward process that can significantly enhance your data control. With a VPS starting at just $6/month, Immich is an excellent choice for developers and homelab enthusiasts looking to manage their media safely and efficiently. By following this guide, you can efficiently deploy and manage your own instance of Immich with relative ease. Happy hosting!