PHPackages                             zenepay/https-local-docker - 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. zenepay/https-local-docker

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

zenepay/https-local-docker
==========================

Dev evironment with nginx, mariadb, phpmyadmin and ssl cert for localhost

1.0.0(1y ago)1721MITShell

Since Sep 21Pushed 1y ago1 watchersCompare

[ Source](https://github.com/zenepay/https-localhost-docker)[ Packagist](https://packagist.org/packages/zenepay/https-local-docker)[ RSS](/packages/zenepay-https-local-docker/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

Dev systems with docker for with ssl for local host
===================================================

[](#dev-systems-with-docker-for-with-ssl-for-local-host)

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

[](#installation)

In your home workspace eg /home /home/project1 /home/project2

We will clone our nginx call sail\_share to home directory /home/sail\_share

```
cd /home
git clone https://github.com/zenepay/https-localhost-docker.git sail_share
cd sail_share
```

This will make 3 docker images for:

1. nginx to route url eg project1.dev.localhost where project1 is running ohter ports eg 8801
2. mariadb database port 3306
3. phpmyadmin to mange mariadb port: 8890

### Setup SSL on localhost

[](#setup-ssl-on-localhost)

Step 1: Generate a CA Certificate
---------------------------------

[](#step-1-generate-a-ca-certificate)

```
mkdir nginx-certs
cd nginx-certs
openssl genrsa -out ca.key -des3 2048
openssl req -x509 -sha256 -new -nodes -days 3650 -key ca.key -out ca.pem
```

Step 2: Generate Certificate, Signed By Our CA
----------------------------------------------

[](#step-2-generate-certificate-signed-by-our-ca)

We already has resources/localhost.ext file, if not yet exist here please using this:

```
authorityKeyIdentifier=keyid,issuer
basicConstraints=CA:FALSE
keyUsage = digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment
extendedKeyUsage = serverAuth, clientAuth
subjectAltName = @alt_names
[req]
req_extensions = req_ext
[req_distinguished_name]
commonName_default = localhost
[req_ext]
subjectAltName = @alt_names
[alt_names]
DNS.1 = *.dev.localhost
DNS.2 = dev.localhost
DNS.3 = localhost

```

Now generate locahost.key file with this command

### Generate a private key

[](#generate-a-private-key)

Choose a simple passphrase eg. NginXpass for your key. Enter it, re-enter it. You are still in the resources folder

```
openssl genrsa -out localhost.key -des3 2048
```

-Generate certificate signing request using key. -Enter the passphrase eg. NginXpass that you chose for the key -Choose defaults or enter information as appropriate. Don't worry about entering anything for "challenge password"

```
openssl req -new -key localhost.key -out localhost.csr
```

### Use the passphrase that you chose for the CA KEY in Step 1.

[](#use-the-passphrase-that-you-chose-for-the-ca-key-in-step-1)

```
openssl x509 -req -in localhost.csr -CA ca.pem -CAkey ca.key \
-CAcreateserial -days 3650 -sha256 \
-extfile ../resources/localhost.ext -out localhost.crt
```

Use the passphrase eg. NginXpass chosen for the localhost key, which is NOT the same as the CA key.

```
openssl rsa -in localhost.key -out localhost.decrypted.key
```

Step 3: Import CA Certificate to Browsers
-----------------------------------------

[](#step-3-import-ca-certificate-to-browsers)

in brownser chrome put url as: chrome://settings/certificates Click Import then browse to nginx-certs/ca.pem Click on the box that says “Trust this certificate for identifying websites.” Click on “OK.”

Step 4: set ip for host in hosts file
-------------------------------------

[](#step-4-set-ip-for-host-in-hosts-file)

C:\\Windows\\System32\\drivers\\etc\\hosts eg:

```
127.0.0.1 kubernetes.docker.internal localhost mariadb dev.localhost *.dev.localhost

192.168.1.111 host.docker.internal
192.168.1.111 gateway.docker.internal

```

Setp 4.1 set db host in wsl host file
-------------------------------------

[](#setp-41-set-db-host-in-wsl-host-file)

sh~~~ sudo nano /etc/hosts

```
Add mysql and mariadb at line localhost

```

172.0.0.1 localhost mysql mariadb

```
## Step 5: edit global.pass
Change your file /nginx/keys/global.pass eg. NginXpass by enter your passphase of the key created above

## Step 6: edit default.conf.template
Change server_name to the subdomain, you want
Chage port to where the docker image is run eg port 8000
proxy_pass	http://host.docker.internal:8000;
```
#for default local nginx hosting
server {
    listen  443 ssl;
    server_name dev.localhost;
    root /var/www/html;

    ssl_certificate     /etc/nginx/certs/localhost.crt;
    ssl_certificate_key /etc/nginx/certs/localhost.key;

    location / {
        index index.php index.html;
    }
    location ~ \.php$ {
        include fastcgi_params;
        fastcgi_pass php:9000;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
    }
}
#for forward proxy hosint with docker or other ports
server {
    listen  443 ssl;
    server_name subdomain.dev.localhost;

    # Self signed certificates
    # Don't use them in a production server!
    ssl_certificate     /etc/nginx/certs/localhost.crt;
    ssl_certificate_key /etc/nginx/certs/localhost.key;

    location / {
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_pass	http://host.docker.internal:8000;
    }
}
```
## Step 7: set network of your docker project to the same
Edit your docker-compose.yml on your docker project (not this project)
must have network zen-network and external: true as below
```
networks:
    sail:
        driver: bridge
        name: zen-network
        external: true
```
## Step 8: create with docker compose
create .env file
```sh
cd ..
mv .env.example .env
mkdir mariadb
```
Now open Docker Desktop to let it start the service,
after that run following to build the image
~~~sh
docker compose up

```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance41

Moderate activity, may be stable

Popularity11

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

 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

Unknown

Total

1

Last Release

605d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/514bdcdca020d9c3e9e50dc74ab9ad7f79283be106fb52f7adfd5595a4faba0d?d=identicon)[zenepay](/maintainers/zenepay)

---

Top Contributors

[![zenepay](https://avatars.githubusercontent.com/u/1179823?v=4)](https://github.com/zenepay "zenepay (15 commits)")

---

Tags

dockerhttpshttps-proxylocalhostmaraidb-datatabasephpmyadminsslhttpsmariadbssldockernginxphpmyadmin

### Embed Badge

![Health badge](/badges/zenepay-https-local-docker/health.svg)

```
[![Health](https://phpackages.com/badges/zenepay-https-local-docker/health.svg)](https://phpackages.com/packages/zenepay-https-local-docker)
```

###  Alternatives

[ryoluo/sail-ssl

Laravel Sail plugin to enable SSL (HTTPS) connection with Nginx.

188672.6k2](/packages/ryoluo-sail-ssl)[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)[spatie/docker

Run a docker container in your PHPUnit tests

478120.2k12](/packages/spatie-docker)[aschmelyun/fleet

Run multiple Laravel Sail websites on your local environment

33269.5k](/packages/aschmelyun-fleet)[testcontainers/testcontainers

Testcontainers implementation in PHP

199184.7k17](/packages/testcontainers-testcontainers)[contributte/bootstrap

Extra contrib to nette/boostrap

111.5M3](/packages/contributte-bootstrap)

PHPackages © 2026

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