Skip to main content

Installation

Online comments are broken. Our open-source commenting platform, Coral, reimagines moderation, comment display, and conversation. Use Coral to add smarter, safer discussions to your site without giving away your data.

More than 500 news sites in 28 countries trust Coral to power their on-site communities, including The Washington Post, The Financial Times, Wired, The Hindu, and Foreign Policy. Read more about Coral here.

Built with ❤️ by Coral by Vox Media.

Requirements#

  • MongoDB ^4.2
  • Redis ^3.2
  • NodeJS ^18.16.0
  • PNPM ^8.0

Running#

You can install Coral using Docker or via Source. We recommend Docker, as it provides the easiest deployment solution going forward, as all the dependencies are baked and shipped with the provided coralproject/talk image.

Docker#

The easiest way to get started with Coral is through our published Docker images. The following assumes that you have Docker and Docker Compose installed on your machine:

# Create directories to persist the data in MongoDB and Redis.mkdir -p data/{mongo,redis}
# Create a secret using a tool like openssl.SIGNING_SECRET="$(openssl rand -base64 48)"
# Create the docker-compose.yml file to get started.cat > docker-compose.yml <<EOFversion: "2"services:  talk:    image: coralproject/talk:7    restart: always    ports:      - "127.0.0.1:5000:5000"    depends_on:      - mongo      - redis    environment:      - MONGODB_URI=mongodb://mongo:27017/coral      - REDIS_URI=redis://redis:6379      - SIGNING_SECRET=${SIGNING_SECRET}  mongo:    image: mongo:4.2    volumes:      - ./data/mongo:/data/db  redis:    image: redis:3.2    volumes:      - ./data/redis:/dataEOF
# Start up Coral using Docker.docker-compose up -d

Then head on over to http://localhost:5000 to install Coral!

Source#

Coral requires NodeJS >=14, we recommend using nvm to help manage node versions https://github.com/nvm-sh/nvm.

# Clone and cd into the Coral directory.git clone https://github.com/coralproject/talk.gitcd talk
# Install dependencies.sh scripts/pnpm-ci.shsh scripts/generate.sh
# Build the application dependencies, this may take some time.sh build.sh

This will build the application code into dist/ folders under the various sub-directories of Coral. Examples of this are server/dist, client/dist, common/dist.

Running Coral with default settings assumes that you have:

  • MongoDB ^4.2 running on 127.0.0.1:27017
  • Redis ^3.2 running on 127.0.0.1:6379

If you don't already have these databases running, you can execute the following assuming you have Docker installed on your local machine:

docker run -d -p 27017:27017 --restart always --name mongo mongo:4.2docker run -d -p 6379:6379 --restart always --name redis redis:3.2

Then start Coral with:

cd serverpnpm run start:development

Then head on over to http://localhost:3000 to install Coral!

Note that if you want to run Coral in production from source, you'll need to create a secret for signing that differs from the unsafe default. You can run the following from your talk directory to do this:

# Create a secret using a tool like openssl.SIGNING_SECRET="$(openssl rand -base64 48)"
# Add a randomly generated secret to your .env file.cat >> server/.env <<EOFSIGNING_SECRET=${SIGNING_SECRET}EOF

You can then run Coral with the production command instead:

# Start the server in production mode.cd serverpnpm run start