Skip to main content

Installation & Hosting Guide

LibreNote is a bot intended for self-hosting. This guide provides instructions for a rudimentary installation of LibreNote via either Docker (recommended) or Node.js.

Preliminary Steps#

Prerequisites#

Discord Application
  1. Select New Application
  2. Enter a name for your application, then select Create
  3. Select Bot on the left panel and then choose Add Bot, confirm the action
  4. Add the bot to your servers
    • https://discord.com/api/oauth2/authorize?client_id=CLIENTID&permissions=8&scope=bot%20applications.commands
    • Replace CLIENTID in the URL with the Application ID from the application's General Information
  5. Take note of your Application ID from the General Information tab, and your Bot Token from the Bot tab
Spotify Client & Secret
  1. Create or log into your Spotify account
  2. Go to your Spotify Dashboard
  3. Select Create an app
  4. Enter an application name and description
  5. Read and agree to the developer terms & branding guidelines
  6. Select Create
  7. Take note of your Client ID and Client Secret

Constructing the .env#

  1. Create a file named .env and give it the following template:
BOT_TOKEN=CLIENT_ID=SPOTIFY_CLIENT_ID=SPOTIFY_CLIENT_SECRET=
  1. This file follows a key=value pattern. Fill it out using the values noted from the prerequisite steps.

Installation#

Docker#

LibreNote is provided as a Docker image, which you may run in a container. This is the recommended method for most hosts. Begin by ensuring that you have Docker and Node.js (v16) installed. You may also need to enable Windows HyperV for Docker on Windows to work.

Redis
Begin by installing and running Redis in Docker:
docker pull redis
docker run --name main-redis -d -p 6379:6379 --restart=unless-stopped redis

When all requirements are met, and Redis is set up, you can install LibreNote in Docker. This can be done with the following commands. In the second command, replace ENV_PATH with the relative or absolute path to the .env file created in the preliminary steps.

docker pull ghcr.io/oprogram/librenote:latestdockerdocker run --name librenote --env-file=ENV_PATH -d --network=host --restart=unless-stopped ghcr.io/oprogram/librenote:latest

Node.js#

Those who elect to avoid Docker, may run LibreNote with Node.js (with or without a process manager). Hosts should be weary of this method, while it is much more easier to set up, there have historically been issues related to the functioning of ytdl, a necessary LibreNote component. As such, it is recommended that most users stick to Docker hosting. For those who wish to use Node, ensure that you have installed Node.js (v16), Git and Redis (Windows Subsystem for Linux) or Redis (Legacy, unmaintained Windows port).

Begin by cloning the LibreNote Git repository.

git clone https://github.com/oprogram/LibreNote.gitcd librenote

At this point, you should wish to move your previously created .env file to the new LibreNote directory which you have cloned. Thereafter, install LibreNote's dependencies and start the bot.

npm installnode dev/commands.jsnode dev/run.js

If no errors are displayed, you may stop the bot via Ctrl + C. You may also set up your desired process manager now.

To start the bot again, simply execute:

node dev/commands.jsnode dev/run.js