{"id":17875706,"url":"https://github.com/cjmellor/saber","last_synced_at":"2026-04-14T10:32:20.675Z","repository":{"id":53202139,"uuid":"174240042","full_name":"cjmellor/saber","owner":"cjmellor","description":"Build a custom LEMP stack and run virtual domains utilising Docker containers","archived":false,"fork":false,"pushed_at":"2019-12-20T12:16:49.000Z","size":204,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-04-03T12:41:56.021Z","etag":null,"topics":["docker","docker-compose","lemp","mariadb","mysql","nginx","php","php-fpm","redis","symfony"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cjmellor.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-03-07T00:05:52.000Z","updated_at":"2019-12-05T21:46:16.000Z","dependencies_parsed_at":"2022-08-21T04:10:21.671Z","dependency_job_id":null,"html_url":"https://github.com/cjmellor/saber","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/cjmellor/saber","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cjmellor%2Fsaber","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cjmellor%2Fsaber/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cjmellor%2Fsaber/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cjmellor%2Fsaber/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cjmellor","download_url":"https://codeload.github.com/cjmellor/saber/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cjmellor%2Fsaber/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31793212,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-14T02:24:21.117Z","status":"ssl_error","status_checked_at":"2026-04-14T02:24:20.627Z","response_time":153,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","docker-compose","lemp","mariadb","mysql","nginx","php","php-fpm","redis","symfony"],"created_at":"2024-10-28T11:24:46.566Z","updated_at":"2026-04-14T10:32:20.652Z","avatar_url":"https://github.com/cjmellor.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![StyleCI](https://github.styleci.io/repos/174240042/shield?branch=master)](https://github.styleci.io/repos/174240042)\n\nHello :wave:\n\nSaber is a tool that allows you to set-up a fully functioning LEMP stack using Docker :whale:\n\nJust a single command to run and you're up and running!\n\n```shell\nsaber new \u003capp-domain\u003e\n```\n\nEach part of the LEMP stack is constructed in a separate container.\n\n-   NGINX\n-   PHP\n-   MySQL / MariaDB\n\nWhen the application is set-up, you can access your new app by visiting it in your browser at `http://your-site.test`\n\nA self-signed certificate can be assigned to the stack and uses the latest TLS security features.\n\n# Table of Contents\n\n-   [Prerequisites](#prerequisites)\n    -   [Configuring DNSMasq](#configuring-dnsmasq)\n-   [Why Saber?](#why-saber)\n-   [Installation](#installation)\n    -   [Available installation options](#available-installation-options)\n-   [Create an App](#create-an-app)\n    -   [Database Management](#database-management)\n    -   [HTTPS](#https)\n    -   [Config](#config)\n    -   [H5BP](#h5bp)\n-   [Secure an App](#secure-an-app)\n-   [Remove an App](#remove-an-app)\n-   [Switch PHP Versions](#switch-php-versions)\n-   [Upgrade](#upgrade)\n-   [Uninstall](#uninstall)\n-   [Contribute](#contribute)\n-   [Contact](#contact)\n\n## Prerequisites\n\n-   MacOS\n-   [Docker / Docker Compose](https://hub.docker.com/editions/community/docker-ce-desktop-mac)\n-   [Homebrew](https://brew.sh/)\n-   DNSMasq\n\n## Configuring DNSMasq\n\n_Already done this? [Skip ahead](#why-saber)_\n\nDNSMasq is required so that Saber can function correctly. Here's a quick guide on getting it set-up. For a more detailed explanation, I recommend reading [this article](https://passingcuriosity.com/2013/dnsmasq-dev-osx/).\n\nInstall DNSMasq - this guide uses **Brew**\n\n```shell\nbrew install dnsmasq\n```\n\nOpen `/usr/local/etc/dnsmasq.conf` and anywhere in the file, add this line\n\n```shell\naddress=/test/127.0.0.1\n```\n\nRestart DNSMasq\n\n```shell\nbrew services restart dnsmasq\n```\n\nThen test it by running a `dig` command\n\n```shell\ndig my.awesome-website.test @127.0.0.1\n```\n\nIf you get a response like so, it works!\n\n```shell\n;; ANSWER SECTION:\nmy.awesome-website.test. 0 IN A 127.0.0.1\n```\n\nNow you need to configure DNSMasq so it can control the way the DNS queries are performed.\n\n```shell\nsudo mkdir -p /etc/resolver\n\nsudo tee /etc/resolver/test \u003e /dev/null \u003c\u003c EOF\nnameserver 127.0.0.1\nEOF\n```\n\nNow any site with a `.test` TLD will resolve to your localhost\n\n```shell\n$ ping -c 5 saber.is.cool.test\nPING saber.is.cool.test (127.0.0.1): 56 data bytes\n64 bytes from 127.0.0.1: icmp_seq=0 ttl=64 time=0.039 ms\n64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.084 ms\n64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.209 ms\n64 bytes from 127.0.0.1: icmp_seq=3 ttl=64 time=0.200 ms\n64 bytes from 127.0.0.1: icmp_seq=4 ttl=64 time=0.142 ms\n\n--- saber.is.cool.test ping statistics ---\n5 packets transmitted, 5 packets received, 0.0% packet loss\n```\n\n# Why Saber?\n\nWhy should you use Saber over something like **Valet** or **Homestead**?\n\nSaber is heavily inspired by Valet. While not a complete fork, it's referenced a lot in the style and format of the code.\n\nSaber was built purely as a fun project to be able to quickly spin up a development environment that can be customised exactly how it is needed to run.\n\nSaber puts customisation ahead of speed when it comes to creating a new development environment. It might take longer to have to pull down Docker images and build them but it means you can have a server specced up to exactly as you want.\n\n# Installation\n\n`composer global require cjmellor/saber`\n\nif you want to run it on a per-project basis, run\n\n```zsh\ncd /to/your/path\ncomposer require cjmellor/saber\n```\n\nNow run the `install` command to install Saber onto your system. You can choose a PHP and Database version on install, or just omit the options\n\n```zsh\nsaber install\n```\n\nor with options\n\n```zsh\nsaber install --php=7.4 --db=mysql:8.0\n```\n\n## Available installation options\n\n| Option | Default        | Description                                            |\n| ------ | -------------- | ------------------------------------------------------ |\n| php    | 7.3            | Just a version number (e.g. _5.6_, _7.4_)              |\n| db     | mariadb:latest | _db:version_ (e.g. _mysql:5.7_). `latest` also allowed |\n\n# Create an App\n\n```shell\nsaber new \u003capp-domain\u003e\n```\n\nCreating an app will spin up the Dockerized LEMP stack.\n\nYour application can be viewed at its domain of the same name _(i.e. an app named `saber-test` will be viewable at `http://saber-test.test`)_. By default, the TLD will always be `.test`.\n\n**Currently, there is no way to change the TLD using Saber. This will change in future versions - PR's welcome!**\n\n## Database Management\n\nThe default credentials are:\n\n|              |          |\n| ------------ | -------- |\n| **User**     | root     |\n| **Pass**     | password |\n| **Database** | default  |\n\nYou can log in to the database as you normally would, via a command line or a GUI.\n\n```shell\nmysql -h 127.0.0.1 -P 3306 -u root -p\n```\n\n## HTTPS\n\nWithout specifying otherwise, the application will be unsecure (`http`). If you want to run the app more securely, when creating your app, specify the `--tls` tag\n\n```shell\nsaber new \u003capp-domain\u003e --tls\n```\n\nThis will create a self-signed certificate. Using the latest security protocols, the application can run on the latest version of TLS (1.3).\n\nYou can [secure or unsecure an app](#secure-an-app) by using the native commands available in Saber.\n\n## Configuration\n\nEach app created with Saber is configurable. You can enable or disable features that matter to you and how you want your environment setup.\n\nWhen a new app is created, all the NGINX and PHP config is stored in a `lemp` folder within' the root\n\nThe NGINX config for each app can be found in:\n\n-   `lemp/nginx/config/conf.d/`\n\nThe PHP config for each app can be found in:\n\n-   `lemp/php/config`\n\n\u003e Don't forget to restart the containers if you make changes to these files\n\n## H5BP\n\nSaber utilises the awesome [H5BP](https://github.com/h5bp/server-configs-nginx) project which keeps the application secure and up-to-date with the latest fixes.\n\n# Remove an App\n\n```shell\nsaber remove \u003capp-domain\u003e\n```\n\nYou can remove an app if you no longer require it.\n\nThis will remove the certificates, the PHP and NGINX configurations and the code folder.\n\n# Switch PHP Versions\n\n```shell\nsaber use 7.3\n```\n\nUsing the `use` command you can switch PHP versions easily!\n\nBy default, Saber encourages you to use stable versions of PHP. You can overwrite this by supplying a `--force` option that will allow you to use other PHP versions.\n\nExample:\n\n```shell\nsaber use --force 5.6.40\n\nsaber use -f 7.4.0RC6-fpm\n```\n\n# Secure an App\n\n```shell\nsaber secure \u003capp-domain\u003e\n```\n\nBy default, apps aren't secure - they're running on `HTTP`. If you want your app to run over `HTTPS` you can run the `secure` command which will assign an SSL certificate to your app.\n\n\u003e The SSL certificates are self-signed.\n\nIf you added an SSL on creation of your app, or you made a mistake and want to start over, you can perform the reverse of this and remove an SSL certificate\n\n```shell\nsaber unsecure \u003capp-domain\u003e\n```\n\n# Upgrade\n\nThe images used to build your environment are often updated by the maintainers of the image, resulting in newer versions and secrity fixes. Normally to upgrade a version of PHP or MySQL it would take many hours to upgrade it manually or lots of tedious tickets or phone calls with your hosting provider.\n\nSaber will pull down the newest versions of the images you want to upgrade and rebuild the containers.\n\n```shell\nsaber upgrade\n```\n\nRun the upgrade command, and you'll be presented with a list of images stored locally on your machine\n\n```shell\nSelect images to upgrade. Select multiple by seperating with a commar, example: 1,3\n  [0] composer:latest\n  [1] php:7.2-fpm-alpine\n  [2] php:7.3-fpm-alpine\n  [3] nginx:alpine\n  [4] mariadb:latest\n \u003e\n```\n\nChoose the image you want to update by typing the corrosponding number and the image will be pulled down and the containers will be rebuilt.\n\nIf you want update multiple images, select the image number in a commar separated value, e.g.\n\n```shell\n\u003e 2,3,4\n```\n\nand those images will be updated.\n\n\u003e Images cannot be updated simultaneously, they will be pulled one at a time before been rebuilt\n\n# Uninstall\n\nNot your cup of tea? That's okay, you can uninstall Saber from your machine - **but you will lose everything!**\n\n```shell\nsaber uninstall\n```\n\n# Contribute\n\n:rotating_light: I encourage you to help me make this tool even more useful! I will be adding more features to it over time.\n\n:bug: There are bound to be some bugs hiding away that have not been counted for - help me get rid of them by creating an issue.\n\n:arrow_down: Please, submit a Pull Request and help me make this tool even better. I'm looking forward to working with other developers on this.\n\n# Contact\n\nFeel free to get in touch! I'm contactable on Twitter [@cmellor](https://twitter.com/cmellor)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcjmellor%2Fsaber","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcjmellor%2Fsaber","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcjmellor%2Fsaber/lists"}