The short answer
Deploying means putting your app on a computer that is always on and reachable from the internet. Right now your app runs on your own computer, so only you can open it. After you deploy it, anyone with the link can.
That computer is called a server. Deploying also gives the app an address, sets its secrets, and connects its database. A host, also called a platform, does the heavy parts for you.
What happens when you deploy
-
Your code is packaged
Your project folder is collected. Folders such as
node_modulesand.gitare skipped, because the server installs those itself. -
The app is built
The server installs your dependencies and runs your build step, if you have one. A build turns your source code into something that can run.
-
The app is started
The server runs your start command. Your app begins to listen on a port, which is a numbered door that requests arrive at.
-
It gets an address
The app is given a web address and a certificate, so the link starts with
https://. -
It is checked
The platform checks that the app answers. If it does not, the deploy fails and says why.
The words you will meet
-
Server. A computer that stays on and answers requests from the internet.
-
Build. The step that installs your dependencies and prepares your code to run.
-
Start command. The command that runs your app, such as
npm run start. -
Port. The numbered door your app listens on. The platform tells your app which one in an environment variable named
PORT. -
Environment variable. A named setting, such as an API key, that you give the app from outside the code.
-
Database. Where your app keeps data that must last, such as users and orders.
-
Domain and address. The name people type. You start with an address on the platform, and later you can add your own.
-
HTTPS. The padlock. It keeps traffic private. It needs a certificate, which the platform issues for you.
-
Logs. What your app printed while it ran. They are how you find out why something broke.
What changes between your computer and a server
Your computer has your files, your .env, your database and your installed tools. A server starts clean. That is why an app that works on your computer can fail online, and why a short list of causes explains most failures.
Three kinds of app
A site made only of files, such as HTML, CSS and images, is a static site. An app with code that runs on the server, such as an Express or Flask app, is a server app. Many tools make both. Static site, server or function explains how to tell which one you have.