Skip to content

A more in depth explanation and walkthrough of setting up a server based instance and ecosystem for the entephotos framework. Includes EntePhoto, MinIO, postgresql, and Caddy.

License

Notifications You must be signed in to change notification settings

aab18011/Ente-Server-Setup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

Step 1: Create the LXC Container in Proxmox

  1. Log into Proxmox VE web UI (https://your-proxmox-ip:8006).
  2. Click Datacenter > your-node > Storage > local (or your ZFS pool if using a dataset for CTs).
  3. Download a template: Click CT Templates > Templates, search for "Ubuntu 24.04 standard" (Ente recommends Ubuntu; Debian 12 works too). Download it.
  4. Click Create CT (top-right).
    • General: Hostname (e.g., "ente-server"), Password (strong root pw).
    • Template: Select the Ubuntu 24.04 template.
    • Root Disk: Size 500GB+ (on your ZFS pool for efficiency).
    • CPU: 4 cores.
    • Memory: 8192MB (8GB).
    • Network: Bridge (vmbr0), static IPv4 (e.g., 192.168.1.100/24), Gateway (your router IP). No IPv6 unless needed.
    • DNS: Use host settings.
    • Confirm: Check "Start after created."
  5. Start the CT, open Console, and log in as root.
  6. Update the system: apt update && apt upgrade -y && apt install sudo curl git -y.
  7. Create a non-root user (e.g., "enteadmin"): adduser enteadmin && usermod -aG sudo enteadmin.
  8. Switch to new user: su - enteadmin (use sudo for root tasks hereafter).

Step 2: Install Dependencies

In the LXC console (as enteadmin):

  1. Install base tools: sudo apt install -y build-essential pkg-config libssl-dev postgresql postgresql-contrib golang-go nodejs npm yarn minio.
    • Go (for server/CLI): If version <1.22, install latest: sudo add-apt-repository ppa:longsleep/golang-backports && sudo apt update && sudo apt install golang-go.
    • Node.js (for web apps): Ensure v20+: sudo npm install -g n && sudo n stable.
    • Enable corepack for Yarn: corepack enable.
  2. Set up PostgreSQL:
    • Start service: sudo systemctl start postgresql && sudo systemctl enable postgresql.
    • Create DB/user: sudo -u postgres psql
      CREATE DATABASE ente_db;
      CREATE USER ente WITH PASSWORD 'strongpassword';
      ALTER USER ente WITH SUPERUSER;
      GRANT ALL PRIVILEGES ON DATABASE ente_db TO ente;
      \q
      
  3. Set up MinIO (local S3 storage):
    • Create data dir: mkdir ~/minio-data.
    • Run MinIO: minio server ~/minio-data --console-address ":9001" & (test; later systemd).
    • Access console at http://lxc-ip:9001, create access key/secret (e.g., key: minioadmin, secret: miniopass).
    • Create bucket: Use mc CLI (sudo apt install minio-client), mc alias set local http://127.0.0.1:9000 minioadmin miniopass, mc mb local/ente-bucket.

Step 3: Build and Configure Ente Services

Ente has a monorepo. Build the server (Go) and web apps (Node).

  1. Clone repo: git clone https://github.com/ente-io/ente.git && cd ente/server.
  2. Configure:
    • Create credentials.yaml (for admin OTP/email):
      admins:
      - youradmin@email.com
      otp: 123456  # Temporary; change after setup
      
    • Create museum.yaml (config; adjust paths):
      db:
        host: localhost
        port: 5432
        name: ente_db
        user: ente
        password: strongpassword
      s3:
        are_local_buckets: true
        use_path_style_urls: true
        local:
          key: minioadmin
          secret: miniopass
          endpoint: http://127.0.0.1:9000
          region: us-east-1
          bucket: ente-bucket
      internal:
        disable-registration: false  # Allow signups
      
  3. Build server: go build -o museum ./cmd/museum.
  4. Run server (test): ./museum -c museum.yaml (runs on port 8080).
  5. Build web apps (in ../web):
    • cd ../web/apps/photos && yarn install && yarn build.
    • Repeat for accounts, auth, cast if needed (Photos is main).
    • Serve web statically (later with Caddy).

For production, use systemd for services.

  • Create /etc/systemd/system/ente-museum.service:
    [Unit]
    Description=Ente Museum Server
    After=network.target postgresql.service
    
    [Service]
    User=enteadmin
    WorkingDirectory=/home/enteadmin/ente/server
    ExecStart=/home/enteadmin/ente/server/museum -c museum.yaml
    Restart=always
    
    [Install]
    WantedBy=multi-user.target
    
  • Similarly for MinIO, PostgreSQL (already enabled), and web (use Caddy to serve builds).

Reload: sudo systemctl daemon-reload && sudo systemctl enable ente-museum && sudo systemctl start ente-museum.

Step 4: Set Up Caddy Reverse Proxy

  1. Install Caddy: sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https curl && curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg && curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list && sudo apt update && sudo apt install caddy.
  2. Configure /etc/caddy/Caddyfile:
    yourdomain.duckdns.org {
        reverse_proxy /api/* http://localhost:8080  # API
        file_server / {
            root /home/enteadmin/ente/web/apps/photos/dist  # Web build dir
        }
        tls {
            dns duckdns your-duckdns-token  # For DNS-01 challenge (get token from DuckDNS)
        }
    }
    
  3. Reload: sudo systemctl reload caddy.
  4. DuckDNS updater: Create script ~/update-duckdns.sh: curl "https://www.duckdns.org/update?domains=yourdomain&token=your-token&ip=". Cron: crontab -e, add */5 * * * * ~/update-duckdns.sh.

Port forward 80/443 on router to LXC IP.

Step 5: User Management and Quotas

  1. Install Ente CLI: go install github.com/ente-io/ente/cli/cmd/ente@latest.
  2. Make yourself admin: ente admin make-admin youradmin@email.com.
  3. For each user (after they sign up via app at https://yourdomain.duckdns.org):
    • Set quota: ente admin update-subscription --user-email user@email.com --storage 107374182400 --validity infinite (100GB in bytes). (For infinite, use --validity -1; adjust as needed).

Step 6: Final Setup and Testing

  • Access web: https://yourdomain.duckdns.org (sign up as admin first).
  • Apps: Download Ente Photos app, set custom endpoint to your domain.
  • Move server: Update DuckDNS IP, restart Caddy if cert fails (it auto-renews).
  • Monitor: Use top/htop for resources; expand LXC if needed via Proxmox UI.
  • Backup: Snapshot LXC in Proxmox; backup DB (pg_dump) and MinIO data.

ALSO:

Follow the instructions at https://help.ente.io/self-hosting/installation/manual as well, as to make sure these steps worked as detailed.

This was completed on a ubuntu version 24.04 LXC running inside of proxmox ve v8.4 This was run on a HP ProLiant DL380 Gen 7, running non-hardware-based Proxmox ZFS in Raid10 with x6 600GB HDDs.

About

A more in depth explanation and walkthrough of setting up a server based instance and ecosystem for the entephotos framework. Includes EntePhoto, MinIO, postgresql, and Caddy.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published