Spin up your development background processes with ease

Nội dung

Developing software requires a lot of attention to detail, and running background services can often be a hassle. However, that’s where Porter comes in. Porter is a command line tool that makes it easy to run background services with only a few configuration lines. With Porter, you can spin up your development background processes with ease, allowing you to focus on developing your software without worrying about the underlying infrastructure.

Porter is designed to be simple to use and set up. You can install Porter with a single command, and you can start running your background services with just a few lines of configuration. Porter uses a YAML file to specify the services you want to run and how they should be configured. This YAML file acts as a blueprint for your services, and Porter takes care of the rest.

I. Install Porter

Requirements

To use Porter you must install supervisord:

  • macOS: brew install supervisor
  • Linux: apt install supervisor

If you want to use the watch feature to restart services when files change you will also need to install:

  • chokidar: npm install --global chokidar

Installation

To install Porter, you can use composer or download the build manually from this repository.

composer global require anystack-sh/porter

II. Porter Uses Example

One of the great features of Porter is its flexibility. Porter can run any type of service, from web servers to databases, and it supports multiple platforms, including Linux, macOS, and Windows. This means that you can use Porter to run your services on any development machine, regardless of the operating system you are using.

Here’s an example from the project’s readme, which makes it convenient to share a porter.yml file with your team with version control:

services:
  - name: Queue
    command: php artisan horizon
    restart:
        watch:
            - app/Jobs
            - app/Mail/WelcomeEmail.php
 
  - name: Vite
    command: npm run dev
 
  - name: Octane
    command: php artisan octane:start --port=8000 --no-interaction
 
  - name: Stripe
    command: stripe listen --forward-to localhost:8000/webhooks/stripe
    restart:
      minutes: 5

To get started, you can initialize a porter.yml file in your project using the porter init command. From there, you can stop, start, add, restart, tail processes, and get process statuses with porter:

# Tail one or more background services
porter tail
 
# Get the status of all configured services
porter status
 
# Start, stop, and restart all services
porter start
porter stop
porter restart

Conclusion

Porter is a powerful and flexible tool that makes it easy to run background services for your development projects. With its simple setup and configuration process, you can focus on developing your software and let Porter handle the underlying infrastructure. Whether you are developing a web application, a mobile app, or any other type of software, Porter can help you spin up your development background processes with ease.

You can learn more about this package, get full installation instructions, and view the source code on GitHub.

Anthony Nguyễn

Cây bút chính tại VietnamTutor

Bài viết cùng chuyên mục

Skills trong Claude Code: biến quy trình thành lệnh tái dùng

Hướng dẫn dùng skills trong Claude Code: cấu trúc SKILL.md, vị trí lưu cho cá nhân và team, kiểm soát ai được gọi skill, và các

Plan mode Claude Code: bắt AI lập kế hoạch trước khi viết code

Bài giải thích plan mode trong Claude Code: cách bật bằng Shift+Tab hoặc /plan, Claude được làm gì khi chỉ-đọc, checklist đọc plan trước khi duyệt,

Checkpoint trong Claude Code: quay lại khi AI sửa hỏng code

Bài giải thích cơ chế checkpoint của Claude Code, cách dùng /rewind để khôi phục code và hội thoại, những trường hợp checkpoint không cứu được,

Permission mode trong Claude Code: chọn mức quyền an toàn

Bài giải thích 6 permission mode của Claude Code, cách đổi chế độ bằng Shift+Tab và cờ khởi động, cùng nguyên tắc chọn mức quyền an

Sửa code bằng Claude Code: quy trình an toàn cho người mới

Bài hướng dẫn quy trình sửa code bằng Claude Code an toàn cho người mới: cách viết yêu cầu, duyệt quyền, kiểm tra thay đổi, kiểm

CLAUDE.md là gì? Cách ghi quy tắc dự án để Claude Code làm đúng

Bài giải thích CLAUDE.md là gì, file này load từ đâu, nên ghi nội dung nào và cách bảo trì để Claude Code làm đúng quy

7 lệnh Claude Code cần biết: /help, /clear, /compact và cách dùng

Bài hướng dẫn 7 lệnh Claude Code quan trọng nhất cho người mới bắt đầu, kèm ví dụ thực tế và thời điểm nên dùng từng

Claude Code là gì? Hướng dẫn cài đặt và chạy dự án đầu tiên

Bài giải thích Claude Code là gì, cách cài đặt đúng trên macOS, Windows và Linux, cùng quy trình chạy dự án đầu tiên an toàn

Prompt vibe coding: mẫu brief để AI hiểu rõ sản phẩm

Prompt vibe coding hiệu quả bắt đầu từ một brief rõ, không phải một câu lệnh dài. Mẫu này giúp bạn mô tả sản phẩm, giới

WordPress cho developer 2026: những thay đổi cần kiểm tra

Bài viết tóm tắt các thay đổi WordPress cho developer 2026 đáng chú ý trong tháng 5: Gutenberg, REST API, block editor, theme và kiểm thử

@wordpress/build là gì? Tooling mới cho plugin WordPress

@wordpress/build là hướng tooling mới cho plugin WordPress: build nhanh hơn, convention-based, hỗ trợ script modules và tự tạo file PHP registration.

Docker sandbox AI coding agent: cấu hình an toàn

Bài viết hướng dẫn lập trình viên cấu hình Docker sandbox AI coding agent để giảm rủi ro khi agent đọc repo, sửa file và chạy