Skip to main content

Manual

Install TeleDrive with manual installation.

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.manual.sh
./install.manual.sh

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

What you'll need

  • PostgreSQL version 14.2 or above:

    Install with this command (Ubuntu):

    sudo apt install postgresql -y
  • Node.js version 16.14.2 or above:

    Install LTS version with command:

    sudo apt install nodejs npm -y    # if, using Ubuntu

    # install stable version
    npm i -g n
    n stable
  • Yarn version 1.22.17 or above:

    Install with npm:

    npm i -g yarn
  • Define all server variables in ./server/.env, you can copy from ./server/.env.example

    cp ./server/.env.example ./server/.env

    Explanation:

    envrequireddescription
    ENVnoHide the logs for production, default: develop
    PORTnoPort for running API, default: 4000
    TG_API_IDyesApplication ID from your Telegram App
    TG_API_HASHyesApplication hash from Telegram App
    ADMIN_USERNAMEyesTelegram username of the admin TeleDrive
    DATABASE_URLyesPostgreSQL connection URI, format: postgresql://[user]:[password]@[host]:[port][/dbname][?paramspec]
  • Define all web variables in ./web/.env, you can copy from ./web/.env.example

    cp ./web/.env.example ./web/.env

    Explanation:

    envrequireddescription
    REACT_APP_API_URLnoBase URL for the API, default: '' (empty string)
    REACT_APP_TG_API_IDyesApplication ID from your Telegram App (for experimental features)
    REACT_APP_TG_API_HASHyesApplication hash from Telegram App (for experimental features)

Database preparation

You need to create and import the database schema.

  • Create database

    Login as postgres user:

    psql -U postgres

    # or
    sudo su - postgres
    psql

    Then, run:

    CREATE DATABASE teledrive;

Note. If you follow the instructions above then you need to fill the server variables:

  • DATABASE_URL: postgresql://postgres@localhost:5432/teledrive

Dependencies installation

Install all dependencies with yarn:

yarn install

Build:

yarn workspaces run build

Run:

yarn server prisma migrate deploy
cd server && node dist/index.js

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

Upgrade

Upgrade to the latest version of TeleDrive with this command:

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

yarn install # install
yarn workspaces run build # build

yarn server prisma migrate deploy
cd server && node dist/index.js # run

Next, you can deploy TeleDrive with Vercel or PM2.