This will be a basic intro into deploying a heroku. I will try to make this as general as possible.
I'm going to start off by listing the steps/commands and then going into detail for each one.
- Create something you want to deploy
- Create heroku account and install heroku CLI
- Install git
heroku loginheroku creategit add .git commit -m "initial commit"git push heroku master- Enjoy!
Alright, let's get started!
-
Create something you want to deploy
From How Heroku Works: "Heroku lets you deploy, run and manage applications written in Ruby, Node.js, Java, Python, Clojure, Scala, Go and PHP." Create a basic skeleton of an application in one of those and lets get started.
-
Create heroku account and install heroku CLI
Navigate to heroku's signup page and create an account. While you're there also install the heroku CLI.
-
Install git
Follow the instructions for your system here.
-
Heroku login
Navigate back to the top folder of your project. Lets say that it's called myApp, I would do
cd myApp. Now that I'm there I would doheroku login. This will give a prompt saying "heroku: Press any key to open up the browser to login or q to exit: ". Press any key and a page will pop up asking you to confirm login. Click the "Log In" button and you're ready to move on. -
Create heroku repository
Note: If you have a front end and a back end using separate languages (i.e. React frontend with Rails backend) then you will need to create a heroku repository for each one!!! Navigate to the top folder of your app. In your terminal enter
heroku create. The previous command also has an optional argument which is what you want to name your heroku repository, this will fail if it's not a unique name to heroku. That's it. You can verify this withgit remote -vwhich will return the url of your heroku repository. -
Put your code up to heroku
In your terminal enter
git add. git commit -m "initial commit" git push heroku master
Now sit back and wait. Go get a snack,coffee,etc. It takes a while for it to upload.
Congratulations! You did it! Now go enjoy writing your new app!
Top comments (0)