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

Nâng Cấp Laravel 13: Checklist 10 Bước Không Thể Bỏ Qua 2026

Hướng dẫn nâng cấp Laravel 13 chi tiết với checklist 10 bước. Từ kiểm tra PHP 8.3, cập nhật dependencies, đến xử lý lỗi thường gặp

Hardening Laravel Production: Checklist Bảo Mật Toàn Diện 2026

Checklist hardening Laravel production toàn diện. Từ cấu hình server, database, SSL đến security headers, rate limiting và monitoring.

Authentication & Authorization Trong Laravel: Hướng Dẫn A-Z 2026

Hướng dẫn chi tiết cách xây dựng hệ thống Authentication (xác thực) và Authorization (phân quyền) trong Laravel với Breeze, Fortify, Sanctum, Policies và Gates.

Bảo Mật Laravel: 10 Lỗi Phổ Biến & Cách Phòng 2026

Hướng dẫn 10 lỗi bảo mật phổ biến nhất trong Laravel và cách phòng tránh hiệu quả. Từ XSS, SQL injection đến authentication vulnerabilities.

Migration PHP Attributes Laravel 13: Hướng Dẫn Chi Tiết

Cách chuyển đổi từ protected properties sang PHP Attributes trong Laravel 13 với hướng dẫn từng bước và code examples chi tiết.

Laravel 13 Có Gì Mới? Tổng Hợp Tính Năng Mới 2026

Laravel 13 ra mắt ngày 17/3/2026 với PHP 8.3, PHP Attributes, AI SDK và nhiều cải tiến. Khám phá chi tiết các tính năng mới của

Kubernetes for Beginners 2026: Hướng Dẫn Từ A-Z

Kubernetes (K8s) là nền tảng container orchestration phổ biến nhất hiện nay. Bài hướng dẫn này sẽ giúp bạn hiểu Kubernetes là gì, kiến trúc cơ

Docker Compose Best Practices 2026: 10 Tips Quan Trọng

Docker Compose giúp bạn quản lý multi-container applications dễ dàng hơn. Bài viết này tổng hợp 10 best practices quan trọng nhất để sử dụng Docker

Lỗ hổng RCE (CVE-2025-55182) trên React, Next.js?

Cảnh báo khẩn cấp: React2Shell (CVE-2025-55182) gây RCE nghiêm trọng cho React/Next.js. Nắm cơ chế, dấu hiệu & phòng thủ cấp bách để bảo vệ ứng

Dead-Letter Queue: Giải pháp cứu cánh cho tin nhắn lỗi hệ thống

DLQ là chìa khóa quản lý tin nhắn lỗi hiệu quả trong hệ thống phân tán. Đảm bảo tin nhắn không bị mất, tăng độ tin

Lập trình viên: Xây doanh nghiệp một người, kiếm 10.000 USD/tháng

Lập trình viên: Khám phá khung làm việc để xây dựng doanh nghiệp một người, kiếm 10.000 USD/tháng. Biến kỹ năng code thành cỗ máy tiền,