# Running Multiple Rails Apps Concurrently with Foreman and Procfile.dev

DevFeed: [Running Multiple Rails Apps Concurrently with Foreman and Procfile.dev](<https://devfeed.tech/articles/running-multiple-rails-apps-concurrently-with-foreman-and-procfile-dev-28290.md>)

Original publisher: [Read original article](<http://fuzzyblog.io/blog/rails/2022/07/18/running-multiple-rails-apps-concurrently-with-foreman-and-procfile-dev.html>)

Author: Fuzzygroup

Published: 2022-07-18T13:15:00Z

Content type: tutorial

Language: en

Sources: [Scott Johnson](<https://devfeed.tech/sources/scott-johnson.md>)

Topics: [Rails](<https://devfeed.tech/topics/rails.md>), [Environment Variables](<https://devfeed.tech/topics/environment-variables.md>), [Development](<https://devfeed.tech/topics/development.md>), [Yarn](<https://devfeed.tech/topics/yarn.md>), [Processes](<https://devfeed.tech/topics/processes.md>), [Unix](<https://devfeed.tech/topics/unix.md>)

Tags: [dev](<https://devfeed.tech/tags/dev.md>), [environment-variables](<https://devfeed.tech/tags/environment-variables.md>), [foreman](<https://devfeed.tech/tags/foreman.md>), [node](<https://devfeed.tech/tags/node.md>), [port](<https://devfeed.tech/tags/port.md>), [process](<https://devfeed.tech/tags/process.md>), [procfile](<https://devfeed.tech/tags/procfile.md>), [rails](<https://devfeed.tech/tags/rails.md>), [run](<https://devfeed.tech/tags/run.md>), [unix](<https://devfeed.tech/tags/unix.md>)

## AI overview

A tutorial on running multiple Rails applications concurrently with Foreman and Procfile.dev. It explains how port conflicts can come from Node running behind Yarn and recommends assigning Yarn a port so Node inherits it through the environment.

## Source excerpt

Pizza courtesy of Pizza for Ukraine! Donate Now to Pizza for Ukraine As I've said, I build a lot of side projects and I really, really like the model of having: ALL MY APPS RUNNING CONCURRENTLY I may be a scattered, distracted developer trying to do too damn much but that's my damn right. And I have 64 gigs of RAM so why shouldn't I be this way. What I want is to be able to switch from app to app and make changes. This is important because some apps provide APIs which other apps rely on and having to figure out what thing is on what port, etc, is just plain distracting. Foreman and Procfile.dev is a way around this but there's a major hitch in your getalong (as my Texas wife might say). Here's a sample Procfile.dev for an app I'm building called Cartazzi which makes a developer's life easier: web: bin/rails server -p 5000 css: yarn build:css --watch js: yarn build --reload # docker: docker-compose up And here's a Profile.dev for another application called Poolwizard which helps you maintain your swimming pool: #web: bin/rails server -p $PORT web: bin/rails server -p 5700 css: yarn build:css --watch js: yarn build --reload # docker: docker-compose up worker: bundle exec sidekiq If you run Cartazzi and Poolwizard together then you're going to get crashes and here's the error: ❯ foreman start -f Procfile.dev 09:11:53 web.1 | started with pid 72877 09:11:53 css.1 | started with pid 72878 09:11:53 js.1 | started with pid 72879 09:11:53 worker.1 | started with pid 72881 09:11:53 js.1 | yarn run v1.22.5 09:11:53 css.1 | yarn run v1.22.5 09:11:53 css.1 | $ tailwindcss --postcss -i ./app/assets/stylesheets/application.tailwind.css -o ./app/assets/builds/application.css --watch 09:11:53 js.1 | $ node esbuild.config.js --reload 09:11:54 js.1 | node:events:371 09:11:54 js.1 | throw er; // Unhandled 'error' event 09:11:54 js.1 | ^ 09:11:54 js.1 | 09:11:54 js.1 | Error: listen EADDRINUSE: address already in use :::5200 09:11:54 js.1 | at Server.setupListenHandle [as _listen2] (no