Setting up a

Satis Server

Follow along:


Share your code as far and
wide as possible using
Composer, even if it means
setting up your own
Satis package server.

What We'll Cover


  • Who Am I
  • You Should Share Code
  • Where To Share
  • How to set up a Satis server
  • Q & A

Who Are You?

Phillip Harrington

You Should
Share Code

For Reals...

Sharing Code
Will Make...


  • Your code better
  • Your documentation better
  • You a better programmer
  • The world a better place

How Can I

Share My Code?

  • Use Composer on your projects
  • Share on GitHub or Packagist
  • Set Up your own package server


Dependency manager for PHP


Git Repository Website


The PHP Package Archivist


Package Server for Composer

Reasons to Use Satis

  • Share with coworkers
  • Proprietary code
  • Convince managers & lawyers


"Talk is cheap. Show me the code."

-- Linus Torvalds

Live Example

Let's set-up a package server!

Install Composer

Run at the command line

$ curl -sS | php

Install Satis Using Composer

Make a composer.json file

    "require": {
        "php": ">=5.3.2",
        "composer/composer": "1.0.*@dev",
        "composer/satis": "1.0.*@dev"



$ php composer.phar install -o

An Example Package!

Configure Satis

Make a satis.json file

    "name": "WebLaCarte Package Server",
    "homepage": "",
    "repositories": [
            "type": "git",
            "url": ""
    "require-all": true

Run Satis


$ vendor/bin/satis build satis.json public

Let's Use
Our Spiffy New
Package Server

A Completely Different
Example Package!

Checkout As A Project


$ git clone Example-Package

Add The Package Server

Modify composer.json

    "repositories": [
            "type": "composer",
            "url": ""

Require The Package

Still in composer.json

    "require": {
        "philsown/Example-Required-Package": "dev-master"


... Again!

$ php composer.phar install -o

It kind of worked!

Local Packages

Back in satis.json, add the "archive" section

    "archive": {
        "directory": "dist",
        "format": "tar",
        "prefix-url": ""

Run Satis

... Again!

$ vendor/bin/satis build satis.json public

Uh Oh!

Add Some Security

Make an .htpasswd File

 $ htpasswd -c .htpasswd composer

Lock Down the Directory 

Make an .htaccess file

AuthType Basic
AuthName "Package Server"
AuthUserFile /path/to/.htpasswd
Require valid-user


Back in your project...
This time, prefer-dist

$ php composer.phar install -o --prefer-dist

Composer Can Do
401 Authentication!


  • Replace templates
  • Pretty Error Pages

Satis Server