Corals is an open source project of The Coral Project that aims to make it easier for newsrooms and journalism organizations to talk with their audiences.
This tutorial will guide you through the process of installing Coral on the latest version of NixOS.
Before you start, make sure you have the following:
To install Coral on NixOS, you need to add it to the nixpkgs repository. Follow the steps below to add Coral.
Open the terminal and switch to the root user by running su
command.
Navigate to the nixpkgs directory by running cd /etc/nixos
.
Edit the configuration.nix
file by running nano configuration.nix
.
Add the Coral package to the environment.systemPackages
list by adding the following lines:
environment.systemPackages = [
(import (fetchTarball "https://github.com/coralproject/coral.nix/archive/master.tar.gz") {})
];
This instruction will fetch the latest Coral package from its source repository and add it to the NixOS package manager.
Save and close the file.
Run nixos-rebuild switch
to rebuild the NixOS configuration.
After adding Coral to nixpkgs, you now need to set up the configuration files to enable it on your website. Follow these steps to set up the configuration files:
Navigate to the coral-files
directory by running cd /etc/nixos/coral-files
.
In this directory, you will see the two necessary files you need to edit: envrc
and dotenv
.
Edit the envrc
file by running nano envrc
.
Add your domain name to the CORAL_TALK_URL
variable like this:
export CORAL_TALK_URL="https://your-domain.com"
Save and close the file.
Next, edit the dotenv
file by running nano dotenv
. You need to fill in the following variables:
# API keys and secrets
export AWS_ACCESS_KEY_ID="your-aws-access-key-id"
export AWS_SECRET_ACCESS_KEY="your-aws-secret-access-key"
export AWS_REGION="your-aws-region"
export TALK_DEVELOPMENT=false
export TALK_SESSION_SECRET="some-random-secret-value-that-you-should-generate"
# configuration
export TALK_DATABASE_URI="mongodb://localhost:27017/coral-database"
# CORS
export TALK_CORS_WHITELIST="*"
export TALK_CLIENT_ORIGIN="https://your-domain.com"
# CDN
export TALK_CDN_URL=""
# moderation
export TALK_MODERATION_ENDPOINT="https://your-moderation-endpoint.com"
export TALK_MODERATION_USERNAME="your-moderation-username"
export TALK_MODERATION_PASSWORD="your-moderation-password"
Note that the values above are just placeholders. You should replace them with your own.
Save and close the dotenv
file.
Follow these steps to start and enable Coral.
sudo systemctl enable coral
to enable the Coral service.sudo systemctl start coral
to start the Coral service.https://your-domain.com/admin
in your browser.Congratulations! You have successfully installed Coral on NixOS. You can now use it to power discussions on your website.
If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!
Alternatively, for the best virtual desktop, try Shells!