# Procfile Confusion

**URL:** <https://community.fly.io/t/procfile-confusion/4225>\
**Category:** Questions / Help\
**Created:** [February 28, 2022, 7:33pm UTC](https://community.fly.io/t/procfile-confusion/4225 "2022-02-28T19:33:30Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![waterstone](https://avatars.discourse-cdn.com/v4/letter/w/a87d85/32.png) [@waterstone](https://community.fly.io/u/waterstone)\
**Post date:** [February 28, 2022, 7:33pm UTC](https://community.fly.io/t/procfile-confusion/4225/1 "2022-02-28T19:33:30Z")

</div>

I have a node.js app running on Fly. It was on Heroku and had the following simple Procfile:

`web: yarn start` (→ `node dist/index.js`)

I removed the Procfile and tried to deploy to Fly, but was met with a deployment error “no default process found”.

Adding the Procfile back fixed the issue, but this isn’t mentioned in Fly’s documentation. I’d like to understand how to configure my processes using `fly.toml` but am new to docker/fly and couldn’t seem to get things right.

Any more guidance on how to specify node.js processes (both exposed to the web, or not) in `fly.toml` would be helpful.

---

<div class="post-metadata">

**Author:** ![rahmatjunaid](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/rahmatjunaid/32/837_2.png) [@rahmatjunaid](https://community.fly.io/u/rahmatjunaid)\
**Post date:** [March 1, 2022, 4:44pm UTC](https://community.fly.io/t/procfile-confusion/4225/2 "2022-03-01T16:44:58Z")

</div>

Hey Brian, thank you for the question. The procfile can be replaced with with a `[processes]` section in the fly.toml.

Procfiles aren’t well documented here but this is something we are planning to expand on. Here is a similar forum post with some more context on procfiles you may find useful - [Procfile documentation](https://community.fly.io/t/procfile-documentation/1169)

---

<div class="post-metadata">

**Author:** ![waterstone](https://avatars.discourse-cdn.com/v4/letter/w/a87d85/32.png) [@waterstone](https://community.fly.io/u/waterstone)\
**Post date:** [March 1, 2022, 6:03pm UTC](https://community.fly.io/t/procfile-confusion/4225/3 "2022-03-01T18:03:44Z")

</div>

I’ve read through what you’ve linked, as well as Fly’s documentation on processes and node.js, and it has not led me to a working solution using `fly.toml`.

To be clear, I would like to know exactly how to specify a node.js process in the fly.toml file that is exposed to the web – **Please help me understand how to turn the following into something that works.**

```auto
[processes]
  web = node dist/index.js

```

---

<div class="post-metadata">

**Author:** ![jerome](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/jerome/32/17_2.png) [@jerome](https://community.fly.io/u/jerome)\
**Post date:** [March 1, 2022, 6:08pm UTC](https://community.fly.io/t/procfile-confusion/4225/4 "2022-03-01T18:08:05Z")

</div>

Does it work if you quote your command?

```nohighlight
[processes]
  web = "node dist/index.js"

```

---

<div class="post-metadata">

**Author:** ![waterstone](https://avatars.discourse-cdn.com/v4/letter/w/a87d85/32.png) [@waterstone](https://community.fly.io/u/waterstone)\
**Post date:** [March 1, 2022, 7:14pm UTC](https://community.fly.io/t/procfile-confusion/4225/5 "2022-03-01T19:14:24Z")

</div>

No ☹

Using–

```auto
# Procfile
web: node dist/index.js

```

–seems to be the only setup I can get to work with custom node.js depoyments on Fly.

Maybe this has something to do with the fact that Fly’s default node.js builder appears to require an index.js or server.js file in the root.

---

<div class="post-metadata">

**Author:** ![kurt](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/kurt/32/43757_2.png) [@kurt](https://community.fly.io/u/kurt)\
**Post date:** [March 1, 2022, 9:12pm UTC](https://community.fly.io/t/procfile-confusion/4225/6 "2022-03-01T21:12:53Z")

</div>

Your app should work without a Procfile if you define an `start` script in `package.json`.

We use the Heroku buildpack for node.js apps, so the Procfile is fine to keep if you want to!

---

<div class="post-metadata">

**Author:** ![waterstone](https://avatars.discourse-cdn.com/v4/letter/w/a87d85/32.png) [@waterstone](https://community.fly.io/u/waterstone)\
**Post date:** [March 1, 2022, 9:54pm UTC](https://community.fly.io/t/procfile-confusion/4225/7 "2022-03-01T21:54:28Z")

</div>

Thanks kurt

In fact, the the first thing I tried was to deploy a node.js project using just a `start` script in `package.json` but that did not seem to work.

Interestingly, having `web: yarn start` in the Procfile (which calls `start` in `package.json`) works, which is what I will use for now – it just wasn’t clear reading through the tutorials that this is the canonical way to use Fly.
