Learn about deployment
Deploying moves your code from your machine to a server that stays online. See how it works, how to size resources and how to fix failures.
Featured
- ConceptsWhat are environment variables?Environment variables are key-value pairs the operating system hands to a process at startup. Learn to read them in Node.js and Python and keep tokens out of code.
- ConceptsWhat is a deployment?A deployment takes a version of your code to a server, prepares it and starts it. See the stages, the methods and how to roll back when it goes wrong.
- CostsHow much RAM and CPU does my app need?Size RAM and CPU by measuring your app's real peak and adding about 30% headroom. Learn how to measure in Node.js, Python and Java and what to do if short.
Concepts8
- What are environment variables?Environment variables are key-value pairs the operating system hands to a process at startup. Learn to read them in Node.js and Python and keep tokens out of code.
- What is a deployment?A deployment takes a version of your code to a server, prepares it and starts it. See the stages, the methods and how to roll back when it goes wrong.
- What does 99.9% uptime actually mean?99.9% uptime allows about 43 minutes of downtime per month. See the math, the difference between uptime, SLO and SLA, and what an SLA really guarantees.
- What is Docker?Docker is a platform that packages an application and its dependencies into an image and runs it as a container. See how it works, a working example and its limits.
- What is CI/CD?CI/CD is the practice of testing every code change automatically (CI) and shipping it to production without manual steps (CD). See how a pipeline works.
- What is cloud hosting?Cloud hosting means running your app on computing resources rented on demand instead of one fixed server. See how it works, the models, and when to use it.
- What is a VPS and when do you need one?A VPS is a virtual private server: a virtual machine with its own OS and root access, rented from a provider. See how it works and when it is worth it.
- What is Docker Compose?Docker Compose defines a multi-container application in one YAML file and starts it with a single command. See how it works, a full example and its limits.
How-to guides10
- Automatic deploys with GitHub ActionsAutomatic deploys with GitHub Actions ship your code to the server on every push. See the workflow step by step, secrets, tests before deploy and common errors.
- The .env file: format, examples and safetyA .env file stores environment variables as plain text, one per line. See the syntax, how to load it in Node.js and Python, and how to keep secrets out of Git.
- Backup strategies: snapshots vs backups and the 3-2-1 ruleThe 3-2-1 rule says keep 3 copies on 2 types of media with 1 offsite. Learn how to apply it to an app and database, how snapshots differ, and a script.
- How to read your app's logs to find the errorTo find an error in your logs, start at the end, scroll up to the first error line, and read the stack trace. Step by step for Node.js and Python.
- Build-time vs runtime environment variablesBuild-time variables are baked into your bundle when you build; runtime variables are read when the app starts. Learn which is which and where secrets can live.
- Deploying a monorepoDeploying a monorepo means shipping one app out of a repo that holds many. Learn to prune dependencies, build one package and deploy it with pnpm and Turborepo.
- PM2 and auto-restart: keeping your process aliveUse PM2 to restart your Node.js process when it crashes, runs out of memory or the server reboots. Covers the ecosystem file, restart limits and Docker.
- Development, staging and production environmentsDevelopment, staging and production are three copies of your app with separate config and data. Learn how to set them up, promote code and keep them from mixing.
- How to dockerize an app (your first Dockerfile)Dockerizing means packaging your app and its dependencies into an image. Learn to write a Dockerfile for Node.js, build it, run it and fix common errors.
- Rollbacks and zero-downtime deploysA rollback restores the last working version; a zero-downtime deploy swaps versions without dropping requests. Learn rolling, blue-green and canary releases.
Problems and errors5
- Deploy failed: how to read build errorsA failed build prints dozens of lines, but only one matters. Learn to find the first real error, match it to its cause and fix npm, pip and TypeScript failures.
- 'Cannot find module' and 'ModuleNotFoundError' on deploy'Cannot find module' (Node.js) and 'ModuleNotFoundError' (Python) mean the runtime cannot locate an import. Learn the common causes and how to fix each.
- Why is my server or app slow? CPU steal, memory and I/OA slow app almost always has a measurable bottleneck: CPU steal, throttling, memory, disk, network or the code itself. Learn how to measure each one and fix it.
- App keeps restarting: out-of-memory (OOM) errors explainedAn app that restarts for no clear reason is often hitting its memory limit. Learn to spot OOM kills in Node.js, Python and Java, find the cause and fix it.
- Works locally but not when deployed: common causesAn app that runs locally but fails after deploy usually differs in environment variables, versions, file paths, ports or missing files. Here is how to find which.
Costs3
- How much RAM and CPU does my app need?Size RAM and CPU by measuring your app's real peak and adding about 30% headroom. Learn how to measure in Node.js, Python and Java and what to do if short.
- How much does it cost to host a Node.js app?Hosting a Node.js app costs from nothing, with limits, to a few dollars a month. See what drives the price, how much RAM your app uses and how each option charges.
- How much does a VPS cost?An entry-level VPS looks cheap on the pricing page, but renewal prices, backups and your own time change the real cost. See how to do the full math.
Comparisons4
- VPS vs cloud platform: what fits your projectA VPS gives you full control of a server and makes you run it. A hosting platform automates the server. See how they differ and when each one fits your project.
- Containers vs virtual machinesContainers and virtual machines isolate apps differently: a container shares the host kernel, a VM brings its own. See how they compare and when to use each one.
- Serverless vs containers for bots and APIsServerless runs functions per request and scales to zero; a container keeps a process running. Compare limits, cold starts and which fits bots and APIs.
- VPS vs shared hostingShared hosting splits one server among many sites and is simple. A VPS gives you root access and reserved resources, but you run it. Here is how to choose.
Which to choose3
- Best way to host a Node.js appThe best way to host Node.js depends on the kind of process: always on or per request. Compare a VPS, a container platform and serverless, scenario by scenario.
- Best way to host a Python appThe best way to host Python depends on the app: a bot, a web API, a scheduled job or AI. Compare VPS, containers and serverless, and see when to use each one.
- Do you need a VPS for a Discord bot?Most Discord bots do not need a VPS: a bot is a light process holding one open connection. See when a VPS pays off, what it demands and the alternatives.