PHPackages                             ignislabs/freighter - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [DevOps &amp; Deployment](/categories/devops)
4. /
5. ignislabs/freighter

ActiveLibrary[DevOps &amp; Deployment](/categories/devops)

ignislabs/freighter
===================

Easy docker development environment management for PHP and Laravel

1.2.1(8y ago)1250MITShell

Since Nov 1Pushed 7y ago1 watchersCompare

[ Source](https://github.com/IgnisLabs/Freighter)[ Packagist](https://packagist.org/packages/ignislabs/freighter)[ RSS](/packages/ignislabs-freighter/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (4)DependenciesVersions (6)Used By (0)

Freighter
=========

[](#freighter)

Easy docker development environment management for PHP and Laravel.

> **You don't need to have a Laravel project to use Freighter.**
> You have more toys if you're using Laravel, but you certainly don't require to do so.
>
> It does come with Laravel-oriented commands, but you don't need to use them.
>
> It also does use the database environment variables names as defined by Laravel, but as long as you have an `.env` file with those variables declared, it's more than enough.

Installation
------------

[](#installation)

You install it with composer:

```
# Install it with composer
$ composer require ignislabs/freighter
```

Then you need to run init just this first time (or when a new version is released):

```
$ bash vendor/ignislabs/freighter/freighter init
```

> `init` copies the freighter binary to the root of your repo, makes it executable and adds it to `.gitignore`, since you don't need to track it.

And now you're ready to use it:

```
$ ./freighter start

```

The Stack
---------

[](#the-stack)

The stack provided is comprehensive, but we try to keep it as minimal as possible by using Alpine Linux whenever possible.

- PHP 7.1 FPM ([latest](https://hub.docker.com/_/php/))
- MySQL 5.7 ([latest](https://hub.docker.com/_/mysql/))
- Nginx ([latest alpine](https://hub.docker.com/_/nginx/))
- Redis ([latest alpine](https://hub.docker.com/_/redis/))
- Beanstalkd (custom alpine — [latest](https://pkgs.alpinelinux.org/package/edge/community/x86/beanstalkd))

Ports
-----

[](#ports)

Inside your containers, the ports will remain the default ones. But when accessing them from the host machine it's a different story.

Freighter plays nice with other services that you might be already running by using easy to remember non-standard ports by default:

- `8000` for Nginx
- `33060` for MySQL
- `63790` for Redis
- `11301` for Beanstalkd

You can override these defaults by setting the appropriate environment variables in your `.env` file to the desired values:

```
# .env

# ...

# Freighter
F_WEB_PORT=80
F_MYSQL_PORT=3306
F_REDIS_PORT=6379
F_QUEUE_PORT=11300

```

Hosts
-----

[](#hosts)

Inside your containers the host names will correspond to the services names as defined in the Compose file, so you'll need to replace them in your `.env` file:

```
# .env

# ...
DB_HOST=mysql
REDIS_HOST=redis
QUEUE_HOST=beanstalkd

```

If using Laravel you'll probably also need to add `QUEUE_HOST` in your `config/queue.php` manually since Laravel comes with it hardcoded by default. Just add `'host' => env('QUEUE_HOST', 'localhost'),` to the `beanstalkd` connection.

MySQL
-----

[](#mysql)

Freighter uses the credentials from environment variables defined in your`.env` file, so you can use those to connect from your host machine.

Just remember to use the correct port (`33060` by default).

The variable names follow the Laravel convention:

```
DB_CONNECTION=mysql
DB_HOST=mysql
DB_PORT=3306
DB_DATABASE=freighter
DB_USERNAME=freighter
DB_PASSWORD=secret

```

Commands
--------

[](#commands)

Freighter comes with a few *native* commands, and more will be coming.

Any unrecognized command will be handed down to `docker-compose`.

You can see any command's help by passing `-h`. Some commands will also show help if you omit all arguments.

### Start and stop your environment

[](#start-and-stop-your-environment)

```
# start the environment in detached mode (up -d)
$ ./freighter start

# bring down the environment
$ ./freighter stop # this is just an alias to docker's native `down`
```

### Customize services

[](#customize-services)

If you want to customize the compose file, you can copy the one in vendor to your repo manually or by running `./freighter copy-services`.

If a compose file is found here, Freighter will use this one instead of the one in vendor.

This way Youy can add services or customize the existing ones. As long as you keep te same service names, you should be fine.

### Composer

[](#composer)

```
$ ./freighter composer
$ ./freighter c  # composer alias

# Example: require a package
$ ./freighter c require predis/predis
```

### Artisan

[](#artisan)

```
$ ./freighter artisan
$ ./freighter art  # artisan alias

# Example: run artisan tinker
$ ./freighter art tinker

# Example: publish vendor files
$ ./freighter art vendor:publish --tag="config"
```

### Laravel logs

[](#laravel-logs)

```
$ ./freighter logs:laravel []

# Example: default laravel logs
$ ./freighter logs:laravel # will tail storage/logs/laravel.log

# Example: other laravel logs (if you have any)
$ ./freighter logs:laravel other # will tail storage/logs/other.log
```

### Testing

[](#testing)

```
# phpspec
$ ./freighter phpspec
$ ./freighter spec  # alias

# Example: generate a spec for a class
$ ./freighter spec desc App\\Foo\\Bar\\Baz

# behat
$ ./freighter behat

# Example: initialize behat
$ ./freighter behat --init
```

### Shell access

[](#shell-access)

```
$ ./freighter shell
$ ./freighter sh  # shell alias

# Example: drop to bash on app container
$ ./freighter shell app

# Use a different shell (for alpine containers)
F_SHELL=sh ./freighter sh nginx
```

### MySQL

[](#mysql-1)

```
$ ./freighter db:dump []

# Example: dump to stdout
$ ./freighter db:dump

# Example: dump to file
$ ./freighter db:dump dump.sql
```

```
# Connect to mysql console
$ ./freighter db:console
$ ./freighter db:clt # db:console alias
```

### Running Docker Compose commands

[](#running-docker-compose-commands)

As I mentioned earlier, any unrecognized command will be handed down to `docker-compose`. So you can run any `docker-compose` command, with the added benefit of having the environment variables in place.

```
# Rebuild services without cache
$ ./freighter build --no-cache

# Show live redis logs
$ ./freighter logs -f redis
```

### Custom commands

[](#custom-commands)

Freighter is incredibly easy to extend (as long as you know your way around bash scripting ![:bowtie:](https://github.githubassets.com/images/icons/emoji/bowtie.png ":bowtie:")).

Just create a directory named `freighter.d` at the root of your repo and add shell scripts in it, Freighter will be pick them up immediately.

These files need to declare functions prefixed as `_fcmd_`, for example: `_fcmd_artisan`.

Take a look at the native ones in `vendor/ignislabs/freighter/freighter.d`so you have an idea of how to write them.

> An artisan command to generate custom Freighter commands even quicker is in the works.

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~2 days

Total

4

Last Release

3110d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/019c54e641913619a9ac66163a02515fa8187062c7128d877903cbc4acfd5391?d=identicon)[Cosmicist](/maintainers/Cosmicist)

---

Top Contributors

[![Cosmicist](https://avatars.githubusercontent.com/u/1039580?v=4)](https://github.com/Cosmicist "Cosmicist (40 commits)")

---

Tags

dockerdocker-composelaravelphpphp7

### Embed Badge

![Health badge](/badges/ignislabs-freighter/health.svg)

```
[![Health](https://phpackages.com/badges/ignislabs-freighter/health.svg)](https://phpackages.com/packages/ignislabs-freighter)
```

###  Alternatives

[deployer/deployer

Deployment Tool

11.0k25.4M207](/packages/deployer-deployer)[appwrite/server-ce

End to end backend server for frontend and mobile apps.

55.3k84.2k](/packages/appwrite-server-ce)[pragmarx/health

Laravel Server &amp; App Health Monitor and Notifier

2.0k1.0M2](/packages/pragmarx-health)[felixfbecker/language-server-protocol

PHP classes for the Language Server Protocol

22476.7M6](/packages/felixfbecker-language-server-protocol)[heroku/heroku-buildpack-php

Toolkit for starting a PHP application locally, with or without foreman, using the same config for PHP and Apache2/Nginx as on Heroku

8161.3M10](/packages/heroku-heroku-buildpack-php)[tiamo/phpas2

PHPAS2 is a php-based implementation of the EDIINT AS2 standard

4674.7k](/packages/tiamo-phpas2)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
