I just deployed my first application to production, and it’s actually accessible on the internet. This feels amazing!
Why Deployment Felt Scary
For months, all my projects only ran on localhost:3000. They worked on my computer, but nobody else could see them.
Deployment seemed complicated:
- Where do I host it?
- How do I get a domain?
- What about databases?
- How do I handle environment variables?
What I Chose
I’m using:
- Heroku for hosting (free tier)
- MongoDB Atlas for database (also free tier)
- Netlify for frontend (if I separate it later)
I chose these because they’re beginner-friendly and have free tiers.
The Deployment Process
Here’s what I had to do:
1. Prepare the app:
- Add a
startscript in package.json - Use environment variables for sensitive data
- Make sure the port is dynamic:
process.env.PORT || 3000
2. Set up Heroku:
- Create an account
- Install Heroku CLI
- Create a new app
- Connect my Git repository
3. Configure environment variables:
- Add DATABASE_URL
- Add JWT_SECRET
- Add any API keys
4. Deploy:
git push heroku main
That’s it! The app is live.
Problems I Ran Into
Environment variables: I forgot to set them in Heroku and my app crashed.
Database connection: My local MongoDB connection string didn’t work. I had to use MongoDB Atlas.
Build errors: Some dependencies that worked locally failed in production.
CORS issues: My frontend couldn’t talk to my backend because of CORS configuration.
What I’m Learning
Production is different from development: Things that work locally might not work in production.
Logs are essential: Heroku logs helped me debug issues.
Environment variables are crucial: Never hardcode secrets, always use env variables.
Free tiers have limits: My app will sleep after 30 minutes of inactivity on Heroku’s free tier.
The Feeling
Seeing my app live on the internet is incredible. I can share the URL with anyone and they can use it.
This makes it feel real. It’s not just a practice project anymore it’s something people can actually access.
What’s Next
Now that I know how to deploy, I want to:
- Learn about CI/CD (automatic deployment)
- Understand Docker
- Learn about custom domains
- Explore other hosting options (AWS, DigitalOcean)
- Set up monitoring and error tracking
My Advice
If you haven’t deployed yet:
Just do it: It’s less scary than it seems.
Start with Heroku: It’s beginner-friendly and has good documentation.
Use free tiers: You don’t need to pay to learn deployment.
Read the logs: When something breaks, logs tell you why.
Deploy early: Don’t wait until your project is perfect. Deploy and iterate.
Deployment is a skill, and the only way to learn it is by doing it. My first deployment wasn’t perfect, but it’s live, and that’s what matters.