Skip to main content

Server

Launch a new server and connect to it using SSH.

Install Node.JS

NiekForm requires Node.js version 17 or higher. You can check your Node.js version by running the following command:

Installing Node.JS with NVM

Check the nvm repository for the latest installation instructions.

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash

Install the latest version of node.

nvm install --lts

Installing yarn

I like yarn, let's install it.

npm install -g yarn

Cloning the repository

Clone the repository and install the dependencies.

git clone {your-repository-url}
cd niekform
yarn

Set environment variables

cp .env.example .env

Edit the .env file and set the environment variables.

KeyExplanationExample
POSTGRES_PASSWORDGenerate some password to be used for postgres authentication(some string)
DATABASE_URLMake sure this contains the POSTGRES_PASSWORDpostgresql://niekform:{POSTGRES_PASSWORD}@localhost:5432/niekform?schema=public
EMAIL_FROMThe email address you want to send email fromniek@example.com
EMAIL_SERVER_USERYour email server userapikey (for sendgrid)
EMAIL_SERVER_PASSWORDYour email server passwordSG.abcdefghijklmnopqrstuvwxyz
EMAIL_SERVER_HOSTYour email server hostsmtp.sendgrid.net
EMAIL_SERVER_PORTEmail server port465, 587
NEXT_PUBLIC_SITE_URLThe URL of your sitehttps://niekform.vercel.app
NEXTAUTH_SECRETA random string of charactersany random string
DATABASE_PROVIDERThe database provider (e.g. postgres), make sure this is the same as the one you set in your prisma/schema.prisma filepostgres/mysql

Installing docker & docker-compose

Read the latest Docker documentation to install Docker on your system.

Debian like systems

See here

Docker-compose

sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose