<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Mohamad Nashaat</title>
    <description>The latest articles on Forem by Mohamad Nashaat (@imohamadnashaat).</description>
    <link>https://forem.com/imohamadnashaat</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3580559%2Fd3431f54-2e34-4502-a4d1-b10730a06f35.jpeg</url>
      <title>Forem: Mohamad Nashaat</title>
      <link>https://forem.com/imohamadnashaat</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/imohamadnashaat"/>
    <language>en</language>
    <item>
      <title>Deploy Your Shopify App to Heroku in Seconds</title>
      <dc:creator>Mohamad Nashaat</dc:creator>
      <pubDate>Thu, 23 Oct 2025 19:16:50 +0000</pubDate>
      <link>https://forem.com/imohamadnashaat/deploy-your-shopify-app-to-heroku-in-seconds-ln</link>
      <guid>https://forem.com/imohamadnashaat/deploy-your-shopify-app-to-heroku-in-seconds-ln</guid>
      <description>&lt;p&gt;Deploying a Shopify app to Heroku can quickly turn into repetitive work — managing environment variables and running multiple commands to keep Shopify and Heroku in sync.&lt;/p&gt;

&lt;p&gt;To simplify this process, I built &lt;a href="https://www.npmjs.com/package/shopify-heroku-cli" rel="noopener noreferrer"&gt;&lt;code&gt;shopify-heroku-cli&lt;/code&gt;&lt;/a&gt; a lightweight CLI that syncs your Shopify app’s environment variables with Heroku and deploys your app in just a couple of commands.&lt;/p&gt;

&lt;p&gt;In this post, I’ll show you &lt;strong&gt;step-by-step how to deploy your Shopify app to Heroku&lt;/strong&gt; using the tool.&lt;/p&gt;




&lt;h2&gt;
  
  
  1. Prerequisites
&lt;/h2&gt;

&lt;p&gt;Before we start, make sure you have the following installed and configured:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Node.js &amp;gt;= 16&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://shopify.dev/tools/cli" rel="noopener noreferrer"&gt;Shopify CLI&lt;/a&gt; — logged in to your Shopify app&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://devcenter.heroku.com/articles/heroku-cli" rel="noopener noreferrer"&gt;Heroku CLI&lt;/a&gt; — logged in to your Heroku account&lt;/li&gt;
&lt;li&gt;A Shopify app ready to deploy&lt;/li&gt;
&lt;li&gt;A Heroku app created (you can create one with &lt;code&gt;heroku create my-shopify-app&lt;/code&gt;)&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  2. Install the CLI
&lt;/h2&gt;

&lt;p&gt;Install the CLI globally using npm:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-g&lt;/span&gt; shopify-heroku-cli
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This makes the &lt;code&gt;shopify-heroku&lt;/code&gt; command available system-wide.&lt;/p&gt;




&lt;h2&gt;
  
  
  3. Sync Environment Variables
&lt;/h2&gt;

&lt;p&gt;The first step is to set your Shopify app environment variables on your Heroku app.&lt;/p&gt;

&lt;p&gt;You can do this with a single command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;shopify-heroku set-env your-heroku-app-name
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command automatically:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Reads your Shopify environment variables&lt;/li&gt;
&lt;li&gt;Pushes them to your Heroku app&lt;/li&gt;
&lt;li&gt;Sets &lt;code&gt;SHOPIFY_API_KEY&lt;/code&gt;, &lt;code&gt;SHOPIFY_API_SECRET&lt;/code&gt;, and &lt;code&gt;SHOPIFY_APP_URL&lt;/code&gt; automatically&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you have multiple Shopify config files (like &lt;code&gt;shopify.app.live.toml&lt;/code&gt;), you can specify one:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;shopify-heroku set-env your-heroku-app-name &lt;span class="nt"&gt;-c&lt;/span&gt; live
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  4. Create a &lt;code&gt;heroku.yml&lt;/code&gt; File
&lt;/h2&gt;

&lt;p&gt;Next, you’ll need a &lt;code&gt;heroku.yml&lt;/code&gt; to tell Heroku how to build your app (using Docker):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="nt"&gt;-e&lt;/span&gt; &lt;span class="s2"&gt;"build:&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s2"&gt;  docker:&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s2"&gt;    web: Dockerfile"&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; heroku.yml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Commit the file to your repo:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git add &lt;span class="nb"&gt;.&lt;/span&gt;
git commit &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"feat: add heroku yml file"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  5. Deploy to Heroku
&lt;/h2&gt;

&lt;p&gt;Now you’re ready to deploy your Shopify app:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;shopify-heroku deploy your-heroku-app-name
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command will:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Ensure your Heroku app is configured for container deployment&lt;/li&gt;
&lt;li&gt;Set up the correct git remote (if missing)&lt;/li&gt;
&lt;li&gt;Automatically detect your main branch (&lt;code&gt;main&lt;/code&gt; or &lt;code&gt;master&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Push your code to Heroku for deployment&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Once complete, you can open your app directly:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;heroku open &lt;span class="nt"&gt;--app&lt;/span&gt; your-heroku-app-name
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  6. Update the Shopify App URL
&lt;/h2&gt;

&lt;p&gt;After deployment, you’ll need to update your app URL in your Shopify configuration file (&lt;code&gt;shopify.app.toml&lt;/code&gt;) to point to your Heroku domain.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight toml"&gt;&lt;code&gt;&lt;span class="py"&gt;application_url&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"https://your-heroku-app-name.herokuapp.com"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then deploy your app to Shopify again to update the URL:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm run deploy
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  7. (Optional) Automate Your Deploy Workflow
&lt;/h2&gt;

&lt;p&gt;You can easily wrap this workflow into a script inside your &lt;code&gt;package.json&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="nl"&gt;"scripts"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"deploy:heroku"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"shopify-heroku set-env your-heroku-app-name &amp;amp;&amp;amp; shopify-heroku deploy your-heroku-app-name"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now you can deploy to Heroku with a single command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm run deploy:heroku
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Wrapping Up
&lt;/h2&gt;

&lt;p&gt;Deploying a Shopify app to Heroku doesn’t have to be complicated.&lt;br&gt;
With shopify-heroku-cli, you can handle environment syncing and deployment in just one command — no more manual setup or juggling multiple CLIs.&lt;/p&gt;

&lt;p&gt;Check out the full documentation and source code here:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;GitHub:&lt;/strong&gt; &lt;a href="https://github.com/imohamadnashaat/shopify-heroku-cli" rel="noopener noreferrer"&gt;imohamadnashaat/shopify-heroku-cli&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;npm:&lt;/strong&gt; &lt;a href="https://www.npmjs.com/package/shopify-heroku-cli" rel="noopener noreferrer"&gt;shopify-heroku-cli&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you find it useful, please share feedback to help make it even better.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Happy deploying!&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>shopify</category>
      <category>heroku</category>
      <category>cli</category>
      <category>cicd</category>
    </item>
  </channel>
</rss>
