Deploying to heroku
Tags: heroku
Published: 2020-04-26 00:00:38

---
title: Deploying to heroku
published: true
description: A basic intro to deploying to heroku
tags: heroku
---
<!-- <style>
code {
    background-color: #eee;
    border-radius: 3px;
    font-family: courier, monospace;
    padding: 0 3px;
}   

    
/* }

.instruction {
    list-style: none;
    conter-reset: my-awesome-counter;
}
.instructions::before {
    content: counter(my-awesome-counter) ". ";
    color: red;
    font-weight: bold;
}
.instructions li h3 {
    /* color: red;
    font-weight: bold;
}
*/
</style> -->
<p>
This will be a basic intro into deploying a heroku. I will try to make this as general as possible.</p>
<p>
I'm going to start off by listing the steps/commands and then going into detail for each one.
</p>

<ol>
<li>Create something you want to deploy</li>
<li><a href="https://signup.heroku.com/">Create heroku account</a> and <a href="https://devcenter.heroku.com/articles/heroku-cli#download-and-install">install heroku CLI</a></li>
<li><a href="https://git-scm.com/book/en/v2/Getting-Started-Installing-Git">Install git</a></li>
<li><code>heroku login</code></li>
<li><code>heroku create</code></li>
<li><code>git add .</code></li>
<li><code>git commit -m "initial commit"</code></li>
<li><code>git push heroku master</code></li>
<li>Enjoy!</li>
</ol>
<p>
Alright, let's get started!
</p>
<ol>
<li><h3>Create something you want to deploy</h3>
<p> 
From 
<a href="https://devcenter.heroku.com/articles/how-heroku-works">How Heroku Works</a>: 
"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.
</p></li>
<li><h3>Create heroku account and install heroku CLI</h3>
<p>
Navigate to <a href="https://signup.heroku.com/">heroku's signup page</a> and create an account. While you're there also <a href="https://devcenter.heroku.com/articles/heroku-cli#download-and-install">install the heroku CLI</a>. 
</p></li>
<li><h3>Install git</h3>
<p> Follow the instructions for your system <a href="https://git-scm.com/book/en/v2/Getting-Started-Installing-Git">here</a>.
</p></li>
<li><h3>Heroku login</h3>
<p>Navigate back to the top folder of your project. Lets say that it's called myApp, I would do <code>cd myApp</code>. Now that I'm there I would do <code>heroku login</code>. 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.</p></li>
<li><h3>Create heroku repository</h3>
<p> <strong>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!!!</strong> Navigate to the top folder of your app. In your terminal enter <code>heroku create</code>. 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 with <code>git remote -v</code> which will return the url of your heroku repository.
</p></li>
<li><h3>Put your code up to heroku</h3>
<p>
In your terminal enter
<pre>
git add.
git commit -m "initial commit"
git push heroku master
</pre>
Now sit back and wait. Go get a snack,coffee,etc. It takes a while for it to upload.
</p></li>
</ol>
Congratulations! You did it! Now go enjoy writing your new app!