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:
Provider | Service Name |
---|---|
Amazon | Amazon Aurora PostgreSQL |
Google Cloud | Cloud SQL for PostgreSQL |
Microsoft Azure | Azure Database for PostgreSQL |
Neon | Neon Database |
Crunchy Data | Crunchy Bridge |
Aiven | Aiven for PostgreSQL |
DigitalOcean | DigitalOcean Managed PostgreSQL |
Heroku | Heroku Postgres |
StackGres | StackGres |
Render.com | Render PostgreSQL Database |
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.
Environment variables
You need to create a .env
file at app root level with at least the following variables:
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:
"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.
# 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"]
Guides for popular app platform services
Here are some quick guides to launch your app in a few minutes: