Our great sponsors
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
-
PostgreSQL
Mirror of the official PostgreSQL GIT repository. Note that this is just a *mirror* - we don't work with pull requests on github. To contribute, please see https://wiki.postgresql.org/wiki/Submitting_a_Patch
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
-
Redis
Redis is an in-memory database that persists on disk. The data model is key-value, but many different kind of values are supported: Strings, Lists, Sets, Sorted Sets, Hashes, Streams, HyperLogLogs, Bitmaps.
-
Nest
A progressive Node.js framework for building efficient, scalable, and enterprise-grade server-side applications with TypeScript/JavaScript 🚀
# For PostgresSQL $ sudo dokku plugin:install https://github.com/dokku/dokku-postgres.git postgres $ dokku postgres:create app-name-db $ dokku postgres:link app-name-db app-name # For MongoDB $ sudo dokku plugin:install https://github.com/dokku/dokku-mongo.git mongo $ dokku mongo:create app-name-db $ dokku mongo:link app-name-db app-name
# For PostgresSQL $ sudo dokku plugin:install https://github.com/dokku/dokku-postgres.git postgres $ dokku postgres:create app-name-db $ dokku postgres:link app-name-db app-name # For MongoDB $ sudo dokku plugin:install https://github.com/dokku/dokku-mongo.git mongo $ dokku mongo:create app-name-db $ dokku mongo:link app-name-db app-name
$ sudo dokku plugin:install https://github.com/dokku/dokku-letsencrypt.git $ dokku config:set --global [email protected] $ dokku domains:set app-name your-domain.com $ dokku letsencrypt:enable app-name $ dokku letsencrypt:cron-job --add
If you are using a PostgreSQL database you will need to change your settings from an options object to a Postgres URL, so have a variable as follows:
If you are using MongoDB you will need to do the same, so you will need the following variable:
The cheapest cloud providers are Linode, DigitalOcean, Vultr and Hetzner, Hetzner being the cheapest.
If you use cache with redis in your API, add Redis plugin to dokku, create a new Redis instance, and link it to your app:
Free Heroku being gone makes developer need to search for alternative deployment options for their NodeJS APPs, in particular for this article NestJS APIs.
Install dokku the PaaS that we will use to deploy our API:
Related posts
- Deploy an Eleventy Blog on Cloudflare pages with Strapi, MySQL, and Dokku on a Digital Ocean Droplet, part 1
- Ask HN: Is there an open source alternative to Digitalocean app platform?
- Ask HN: How are you hosting multiple small apps?
- The Best Way to Deploy Your Own Apps
- Zero downtime deployments of containers on locally running server