Skip to main content

Docker

Install TeleDrive with docker-compose.

Prerequisite

Get started by installing all needed services and define all variables.

⚠️ Experimental ⚠️

You can directly build and run the application with bash script.

chmod +x ./install.docker.sh
./install.docker.sh

If it's succeed you don't need to follow the steps below.

What you'll need

  • Docker version 20.10.13 or above

  • Docker compose version 2.3.3 or above

  • Define all .env variables in ./docker/.env, you can copy from ./docker/.env.example

    cp ./docker/.env.example ./docker/.env

    Explanation:

    envrequireddescription
    ENVnoHide the logs for production, default: develop
    PORTnoSet custom application port for running, default: 4000
    TG_API_IDyesApplication ID from your Telegram App
    TG_API_HASHyesApplication hash from Telegram App
    ADMIN_USERNAMEyesTelegram username of the admin TeleDrive
    DB_PASSWORDyesDatabase password

Build and Run

Build and run with this command:

cd docker
docker-compose up -d

Done! You can now open localhost:4000 in your browser 🎊

View the app logs with this command:

docker-compose logs teledrive --follow

Note. You need to set ENV=develop in the variables to logging all events.

Stop the services by:

docker-compose down

Upgrade

Upgrade to the latest version of TeleDrive with this command:

git pull origin main    # or, staging for the latest updates

docker-compose down
docker-compose up --build --force-recreate -d
docker image prune -f # remove dangling images

Common Issues

  • App not running after I run up -d

    Try to up the services again with command:

    docker-compose up -d

Next, you need to reverse proxy the application to your domain with Nginx.