An application running on your machine is not a thing anybody else can use, and the gap between those two states is where an enormous number of personal projects stop permanently. It is a much smaller gap than it was.
What are the options?
- Application platforms. Connect a repository, they build and run it.
- Static hosting. For anything without a server component.
- Containers on a managed service. More control, more configuration.
- A virtual server. Full control and full responsibility.
Which should a first project use?
An application platform, without much hesitation. Connecting a repository and having it deploy on every push removes server administration, certificates, restarts and most of what makes deployment intimidating.
A virtual server teaches you more and it teaches you system administration rather than application development, which is a different subject.
What has to change from local?
Configuration, mainly. Anything hard-coded to your machine breaks: file paths, the database location, the address the app listens on, and any assumption about a local service being available.
Go through this application and list everything that would break when deployed: hard-coded paths, local addresses, values that should come from the environment, and anything that assumes a service is running on the same machine.
What about the database?
A managed one from the platform, rather than a file alongside the application. A file-based database on an application platform is frequently lost on redeployment, which is a surprising and complete data loss.
Managed databases handle backups, which is the other thing worth having before real data exists.
What is the first deployment usually blocked by?
A missing environment variable, a dependency not listed, or a build command the platform cannot infer. All three are visible in the deployment logs, which are the first place to look rather than the last.
Expecting three or four failed attempts is realistic, and each one produces a specific message.
How do you avoid the works-on-my-machine problem?
By listing dependencies explicitly with versions, and by keeping configuration in the environment rather than in code. Those two remove most of the difference between the two places it runs.
Keeping a staging environment is worth it once anybody depends on the application, since it gives you somewhere to confirm a deployment works before it reaches the people using it.
What should happen automatically?
Deployment on push to the main branch, once you trust it. That is a few minutes of setup and it removes the friction that otherwise makes people batch up changes and deploy rarely, which is how deployments become risky.
What should you do before the first real user?
Confirm backups exist and can be restored, check that the application works over a secure connection, and make sure errors are recorded somewhere you will see them.
What should you do about backups?
Confirm they exist and restore one, before there is anything worth losing. A managed database usually takes automatic backups, and an untested backup is a hope rather than a plan.
The exercise takes half an hour: restore to a separate database, connect to it, confirm the data is there. Doing it once tells you whether the arrangement works and roughly how long a recovery takes, which are both things you want to know in advance rather than at the moment you need them.
What does it cost?
Frequently nothing at this stage. Most platforms have free tiers adequate for a small application with modest traffic, with the trade being slower response after a period of inactivity, which is acceptable for a project nobody is depending on yet.