Skip to content

Installation

tech-kev edited this page Mar 25, 2026 · 2 revisions

Installation

Docker (recommended)

1. Create a docker-compose.yml

services:
  sharedmoments:
    image: techkev/sharedmoments
    container_name: sharedmoments
    restart: unless-stopped
    ports:
      - "5001:5001"
    volumes:
      - sm-database:/app/app/database
      - sm-uploads:/app/app/uploads
      - /etc/localtime:/etc/localtime:ro
    environment:
      - SECRET_KEY=CHANGE-ME

volumes:
  sm-database:
  sm-uploads:

2. Generate a secure secret key

python3 -c "import secrets; print(secrets.token_hex(32))"

Replace CHANGE-ME with the generated key.

3. Start the container

docker compose up -d

4. Open the setup wizard

Open http://your-ip:5001 in your browser and complete the Setup Wizard.

See the full docker-compose.yml in the repository for all available options (AI, notifications, migration, etc.).


Native Install Script

Supported on Debian/Ubuntu, Fedora/Rocky, and CentOS:

curl -fsSL https://raw.githubusercontent.com/tech-kev/SharedMoments/main/install.sh | sudo bash

The script installs all dependencies, sets up a Python virtual environment, and configures a systemd service.


Updating

Docker

Pull the latest image and restart:

docker compose pull && docker compose down && docker compose up -d

Database migrations run automatically on startup.

Native Installation

Run the update script from your installation directory:

sudo bash /opt/sharedmoments/update.sh

The update script will:

  1. Create a backup of your configuration (.env) and database
  2. Stop the service
  3. Pull the latest code from the repository
  4. Update Python dependencies
  5. Run database migrations and restart the service

If something goes wrong, the script shows rollback instructions at the end, including how to restore your database and revert to the previous version.

Clone this wiki locally