> ## Content Index
> Fetch the complete content index at: https://ricofritzsche.me/llms.txt
> Use this file to discover other available public pages before exploring further.

# Successfully Deploying a .NET Core App on Heroku from a Macbook with M1 Chip
- URL: https://ricofritzsche.me/successfully-deploying-a-net-core-app-heroku/
- Published: 2023-07-20T18:13:56.000Z
- Updated: 2024-03-04T13:35:09.000Z
- Description: I show you how to create a .NET Core application using the CLI, dockerize it, and tackle the tricky part - deploying it from a MacBook M1. I explain why you may encounter an 'Exec format error' during deployment and provide an efficient workaround using Github workflows.
- Author: Rico Fritzsche
- Tags: Software Development

Ever hit a roadblock deploying your .NET Core application on Heroku, especially from a MacBook with an M1 chip? We've got you covered in my latest Medium post!

In this post, I show you how to create a .NET Core application using the CLI, dockerize it, and tackle the tricky part - deploying it from a MacBook M1\. I explain why you may encounter an 'Exec format error' during deployment and provide an efficient workaround using Github workflows.

![](https://storage.ghost.io/c/5b/3f/5b3fa9cb-95b3-4667-98c5-ca3c2c9a3233/content/images/image/fetch/w_2000,h_2000,c_fill,f_jpg,q_auto:good,fl_progressive:steep,g_auto/https-3a-2f-2fsubstack-post-media.s3.amazonaws.com-2fpublic-2fimages-2f6d4b1e9b-0667-41b4-9f01-acca34d21da8_2206x800.jpg)

Here are the basics:

**Set Up the .NET Core Application:** Use the CLI to create a minimalistic REST API, ready for deployment.

```
dotnet new web -o MyAPI
```

**Dockerize the Application:** With my detailed guide, learn to create an optimized Dockerfile that suits .NET Core 7.0.

**Deploy the Application:** On an Intel architecture Mac, deployment is as simple as pushing to Heroku using Heroku CLI commands. But if you're on a MacBook M1, you'll need to use a Github workflow to build, push, and release the Docker container to Heroku.

```
name: API Deployment
on:
  push:
    branches: [main]
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - name: Checkout
      uses: actions/checkout@v2
    - name: Build, Push and Release Docker container to Heroku
      uses: gonuit/heroku-docker-deploy@v1.3.3
      with:
        email: ${{ secrets.HEROKU_EMAIL }}
        heroku_api_key: ${{ secrets.HEROKU_API_KEY }}
        heroku_app_name: ${{ secrets.HEROKU_APP_NAME }}
        dockerfile_directory: ./
        dockerfile_name: Dockerfile
        docker_options: "--no-cache"
        process_type: web

```

In just a few steps, your .NET Core application is up and running on Heroku, even from a MacBook M1\. Now, isn't that smooth?

For a detailed walkthrough, visit the full post [here](https://medium.com/@rico-fritzsche/how-to-configure-dockerize-and-deploy-a-net-core-application-on-heroku-from-a-mac-m1-machine-d09173560a4?ref=ricofritzsche.me).

Stay tuned for more tech tips!