Skip to content

Installation guide

Robin edited this page Jan 18, 2021 · 38 revisions

Downsides of using the central bot instance:

  • you give your API key to us
  • it may go down unexpectedly
  • in case of a backwards-incompatible change, the bot will break for you until you upgrade your website

Only self-host if you know what you're doing, we provide limited support for self-hosting.

Stateless mode (recommended)

Does not require a database, only allows one website and one Discord server. This is the easiest to set up and recommended for everyone hosting a bot for their website.

Using docker (recommended)

  1. Download the example stateless docker-compose file and save it as docker-compose.yaml (right click the link -> save as)
  2. Fill in the required settings and read the comments about making the bot accessible outside of the container
  3. Start in foreground using docker-compose up. If it works, start in background using docker-compose up -d.

Manually

  1. Install Java 11 or higher (e.g. apt install openjdk-11-jre-headless)
  2. Create and enter a directory for the bot files, e.g. /opt/nameless/discord
  3. Download the bot jar file here
  4. Create a script to launch the bot (e.g. start.sh). Set environment variables then start the bot using java -jar Nameless-Link.jar. Example:
    #!/bin/bash
    set -e
    export BOT_URL="http://localhost:27362"
    export WEBSERVER_PORT="27362"
    export API_URL="enter nameless api url here"
    export GUILD_ID="enter discord server id here"
    export DISCORD_TOKEN="enter bot token here"
    java -jar Nameless-Link.jar
  5. Try running the script using bash start.sh
  6. If it works, create a systemd unit file to run it as a daemon at startup. Example, might need changing:
    [Unit]
    Description=Nameless Link Bot Service.
    
    [Service]
    Type=simple
    ExecStart=/bin/bash /opt/nameless/discord/start.sh
    
    [Install]
    WantedBy=multi-user.target
    
    1. Put contents above in file /etc/systemd/system/nlink.service
    2. Run chmod 644 /etc/systemd/system/nlink.service
    3. Run systemctl start nlink and systemctl status nlink

Database mode

This is what we use to host the central bot.

Using docker

  1. Download the example postgres docker-compose file and save it as docker-compose.yaml (right click the link -> save as)
  2. Fill in the required settings and read the comments about making the bot accessible outside of the container
  3. Start in foreground using docker-compose up. If it works, start in background using docker-compose up -d.

There is no systemd service file or example start script available at this time.

Clone this wiki locally