{"id":17727640,"url":"https://github.com/kevinpareek/lamp-docker","last_synced_at":"2025-10-18T16:49:21.936Z","repository":{"id":259294180,"uuid":"877146785","full_name":"kevinpareek/lamp-docker","owner":"kevinpareek","description":"A customizable Docker-based LAMP stack environment, featuring PHP 8.3, MariaDB 10.6, Apache, and Xdebug, designed for easy local development on Apple Silicon and Linux.","archived":false,"fork":false,"pushed_at":"2025-03-22T08:51:58.000Z","size":151,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-22T09:27:57.474Z","etag":null,"topics":["apache","docker","docker-compose","lamp","lamp-stack","mariadb","mysql","php","phpmyadmin"],"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/kevinpareek.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-23T07:02:37.000Z","updated_at":"2025-03-22T08:52:01.000Z","dependencies_parsed_at":"2024-10-24T06:13:04.525Z","dependency_job_id":"6ccdab7c-1d94-4ccc-bec1-fce95278671c","html_url":"https://github.com/kevinpareek/lamp-docker","commit_stats":null,"previous_names":["kevinpareek/lamp-docker"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kevinpareek%2Flamp-docker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kevinpareek%2Flamp-docker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kevinpareek%2Flamp-docker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kevinpareek%2Flamp-docker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kevinpareek","download_url":"https://codeload.github.com/kevinpareek/lamp-docker/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246490921,"owners_count":20786080,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["apache","docker","docker-compose","lamp","lamp-stack","mariadb","mysql","php","phpmyadmin"],"created_at":"2024-10-25T18:07:05.772Z","updated_at":"2025-10-18T16:49:21.837Z","avatar_url":"https://github.com/kevinpareek.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LAMP Stack Built with Docker Compose\n\nA comprehensive LAMP stack environment built using Docker Compose, featuring:\n\n- PHP\n- Apache\n- MySQL\n- phpMyAdmin\n- Redis\n\n\u003e **Note:** This Docker Stack is intended for local development and is not suitable for production use.\n\n## Installation\n\n1. **Clone the repository:**\n    ```sh\n    git clone https://github.com/kevinpareek/lamp-docker.git\n    cd lamp-docker\n    ```\n\n2. **Configure environment variables:**\n    ```sh\n    ./lamp.sh config\n    ```\n    Follow the prompts to set up the necessary environment variables.\n\n3. **Build and start the LAMP stack:**\n    ```sh\n    ./lamp.sh start\n    ```\n\n## Usage\n\n### Starting and Stopping the LAMP Stack\n\n- **Start:**\n    ```sh\n    ./lamp.sh start\n    ```\n\n- **Stop:**\n    ```sh\n    ./lamp.sh stop\n    ```\n\n- **Restart:**\n    ```sh\n    ./lamp.sh restart\n    ```\n\n### Accessing Services\n\n- **Web Server:** Accessible at `http://localhost` or `https://localhost` (if SSL is configured).\n- **phpMyAdmin:** Accessible at `http://localhost:8080` or `https://localhost:8443`.\n\n### Creating \u0026 Managing Applications\n\n- **Add a new application:**\n    Ensure your custom domain (e.g., example.com) points to 127.0.0.1 if not using the default localhost.\n\n    ```sh\n    ./lamp.sh addapp \u003capp_name\u003e [domain]\n    ```\n    - `\u003capp_name\u003e`: Name of the application.\n    - `[domain]`: (Optional) Custom domain, defaults to `\u003capp_name\u003e.localhost`.\n    - Place your code in `[DOCUMENT_ROOT]/[APPLICATIONS_DIR_NAME]/\u003capp_name\u003e`.\n    - Create a database in phpMyAdmin (`http://localhost:8080`) named `sql_\u003capp_name\u003e`.\n\n- **Open application code in VS Code:**\n    ```sh\n    ./lamp.sh code \u003capp_name\u003e\n    ```\n    - `\u003capp_name\u003e`: Name of the application. If omitted, you'll be prompted to select an application.\n\n### Backup and Restore\n\n- **Backup:**\n    ```sh\n    ./lamp.sh backup\n    ```\n\n- **Restore:**\n    ```sh\n    ./lamp.sh restore\n    ```\n\n### Connect via SSH\n\nfollowing command to log in to the container via SSH:\n```sh\n./lamp.sh cmd\n```\n\n## SSL Certificates\n\n- **Generate SSL certificates for a domain:**\n    ```sh\n    ./lamp.sh ssl \u003cdomain\u003e\n    ```\n    - `\u003cdomain\u003e`: The domain for which to generate SSL certificates.\n\nWe use tool like [mkcert](https://github.com/FiloSottile/mkcert#installation) to create an SSL certificate. So need to \ninstall mkcert first to generate SSL certificates.\n\n\n## Configuration\n\n- This package comes with default configuration options. You can modify them by creating a `.env` file in your root directory. \nTo make it easy, just copy the content from the `sample.env` file and update the environment variable values as per your need.\n\n- The installed version of PHP and MYSQL depends on your `.env` file.\n\n\n### Apache Modules\n\nBy default, the following modules are enabled:\n- rewrite\n- headers\n\n\u003e If you want to enable more modules, update `./bin/phpX/Dockerfile`. Rebuild the Docker image by running `docker compose \nbuild` and restart the Docker containers.\n\n\n### Extensions\n\nBy default, the following extensions are installed (may differ for PHP versions \u003c7.x.x):\n- mysqli\n- pdo_sqlite\n- pdo_mysql\n- mbstring\n- zip\n- intl\n- mcrypt\n- curl\n- json\n- iconv\n- xml\n- xmlrpc\n- gd\n\n\u003e If you want to install more extensions, update `./bin/webserver/Dockerfile`. Rebuild the Docker image by running `docker \ncompose build` and restart the Docker containers.\n\n## phpMyAdmin\n\nphpMyAdmin is configured to run on port 8080. Use the following default credentials:\n- URL: `http://localhost:8080/`\n- Username: `root`\n- Password: `tiger`\n\n## Xdebug\n\nXdebug comes installed by default, and its version depends on the PHP version chosen in the `.env` file.\n\n**Xdebug versions:**\n- PHP \u003c= 7.3: Xdebug 2.X.X\n- PHP \u003e= 7.4: Xdebug 3.X.X\n\nTo use Xdebug, enable the settings in the `./config/php/php.ini` file according to the chosen PHP version.\n\nExample:\n```ini\n# Xdebug 2\n#xdebug.remote_enable=1\n#xdebug.remote_autostart=1\n#xdebug.remote_connect_back=1\n#xdebug.remote_host = host.docker.internal\n#xdebug.remote_port=9000\n\n# Xdebug 3\n#xdebug.mode=debug\n#xdebug.start_with_request=yes\n#xdebug.client_host=host.docker.internal\n#xdebug.client_port=9003\n#xdebug.idekey=VSCODE\n```\n\n### Xdebug VS Code\n\nInstall the Xdebug extension \"PHP Debug\" in VS Code. Create the launch file so that your IDE can listen and work properly.\n\nExample:\n```json\n{\n    \"version\": \"0.2.0\",\n    \"configurations\": [\n        {\n            \"name\": \"Listen for Xdebug\",\n            \"type\": \"php\",\n            \"request\": \"launch\",\n            // \"port\": 9000, // Xdebug 2\n            \"port\": 9003, // Xdebug 3\n            \"pathMappings\": {\n                // \"/var/www/html\": \"${workspaceFolder}/www\" // if you have opened VSCODE in root folder\n                \"/var/www/html\": \"${workspaceFolder}\" // if you have opened VSCODE in ./www folder\n            }\n        }\n    ]\n}\n```\n\nMake a breakpoint and run debug. After these configurations, you may need to restart the container.\n\n## Redis\n\nRedis runs on the default port `6379`.\n\n\n## Contributing\n\nWe welcome contributions! If you want to create a pull request, please remember that this stack is not built for production \nusage, and changes should be good for general purposes and not overspecialized.\n\n\u003e Please note that we simplified the project structure from several branches for each PHP version to one centralized master \nbranch. Please create your PR against the master branch.\n\n## Why You Shouldn't Use This Stack Unmodified in Production\n\nThis stack is designed for local development to quickly create creative applications. In production, you should modify at a \nminimum the following subjects:\n- PHP handler: mod_php =\u003e php-fpm\n- Secure MySQL users with proper source IP limitations\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkevinpareek%2Flamp-docker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkevinpareek%2Flamp-docker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkevinpareek%2Flamp-docker/lists"}