Skip to main content

Deploy Manifest

Manifest is made to be self-hosted: backends can be deployed with ease wherever you want using different methods.

We recommend using Docker to simplify deployments but you also can install Manifest manually on a VM or on a bare-metal server.

System requirements

The minimum system requirements to run a small Manifest backend are 1vCPU and 512 MB RAM. It usually corresponds to one of the cheapest option on cloud providers.

The server needs at least Node.js v18 or more and a process manager like pm2.

Database

Manifest works by default in local with SQLite but we recommend to switch to PostgreSQL for production deployments.

All popular hosting providers have their managed PostgreSQL solutions and there is many DB-as-a-Service providers like Neon that offer generous free-tier to get started. Here is a list of popular services:

ProviderService Name
AmazonAmazon Aurora PostgreSQL
Google CloudCloud SQL for PostgreSQL
Microsoft AzureAzure Database for PostgreSQL
NeonNeon Database
Crunchy DataCrunchy Bridge
AivenAiven for PostgreSQL
DigitalOceanDigitalOcean Managed PostgreSQL
HerokuHeroku Postgres
StackGresStackGres
Render.comRender PostgreSQL Database
tip

While you could technically create a Docker volume to ensure data persistence for your SQLite database, we found it easier to use any managed PostgreSQL service even if you never used PostgreSQL.

Storage

As for the database, uploaded files and images will be flushed when the container restarts if using Docker.

danger

We are currently working on integrating S3 storage services to prevent those data losses. In the meantime we do not recommend to deploy your app in prod if you rely on file or image uploads.

Environment variables

You need to create a .env file at app root level with at least the following variables:

.env
TOKEN_SECRET_KEY=%ReplaceByYourKey%
NODE_ENV=production
BASE_URL=https://my-backend.com

See more environment variables you may need.

Start script for production

The npm run manifest script should only be used for development as it watches file changes.

Go back to your codebase and open the package.json file and add a new start script on the scripts list with the value node node_modules/manifest/dist/manifest/src/main.js as following:

package.json
"scripts": {
"start": "node node_modules/manifest/dist/manifest/src/main.js"
[...]
}

After that you will be able to run Manifest for production with npm run start.

Docker

Docker is a popular choice among developers. It uses containerization to ensure that the app will work well whatever the environment.

Dockerfile
# Use the official Node.js image as a base
FROM node:18-slim

# Copy package.json and package-lock.json (if available)
COPY package*.json ./

# Install dependencies
RUN npm install && npm cache clean --force && rm -rf /root/.npm && rm -rf /tmp/*

# Copy the rest of your application code
COPY . .

# Set the NODE_ENV environment variable
ENV NODE_ENV=production

# Expose the port the app runs on (adjust as needed)
EXPOSE 1111

# Start the application
CMD ["npm", "run", "start"]

Here are some quick guides to launch your app in a few minutes: