{"id":24516019,"url":"https://github.com/damalis/full-stack-apache2-grav-for-everyone-with-docker-compose","last_synced_at":"2025-08-26T22:03:23.545Z","repository":{"id":144672939,"uuid":"585464303","full_name":"damalis/full-stack-apache2-grav-for-everyone-with-docker-compose","owner":"damalis","description":"If You want to build a website with Grav at short time; install full stack apache2 Grav with Docker Compose. Plus, manage docker containers with Portainer.","archived":false,"fork":false,"pushed_at":"2024-07-07T07:33:04.000Z","size":132,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-22T01:22:35.754Z","etag":null,"topics":["apache2","backup","certbot","cms","content-management","framework","grav","letsencrypt","php","portainer-ce","redis","ssl","symfony","website-builder","website-generation"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/damalis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":null,"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},"funding":{"github":["damalis"]}},"created_at":"2023-01-05T08:34:40.000Z","updated_at":"2024-07-06T17:21:19.000Z","dependencies_parsed_at":"2024-03-25T10:53:37.933Z","dependency_job_id":null,"html_url":"https://github.com/damalis/full-stack-apache2-grav-for-everyone-with-docker-compose","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/damalis%2Ffull-stack-apache2-grav-for-everyone-with-docker-compose","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/damalis%2Ffull-stack-apache2-grav-for-everyone-with-docker-compose/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/damalis%2Ffull-stack-apache2-grav-for-everyone-with-docker-compose/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/damalis%2Ffull-stack-apache2-grav-for-everyone-with-docker-compose/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/damalis","download_url":"https://codeload.github.com/damalis/full-stack-apache2-grav-for-everyone-with-docker-compose/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243719373,"owners_count":20336596,"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":["apache2","backup","certbot","cms","content-management","framework","grav","letsencrypt","php","portainer-ce","redis","ssl","symfony","website-builder","website-generation"],"created_at":"2025-01-22T01:20:32.308Z","updated_at":"2025-08-26T22:03:23.535Z","avatar_url":"https://github.com/damalis.png","language":"Shell","readme":"# [full stack apache2 Grav for everyone with docker compose](https://github.com/damalis/full-stack-apache2-grav-for-everyone-with-docker-compose)\n\nIf You want to build a website with Grav at short time; \n\n#### Full stack Apache2 Grav:\n\u003cp align=\"left\"\u003e \u003ca href=\"https://getgrav.org/\" target=\"_blank\" rel=\"noreferrer\"\u003e \u003cimg src=\"https://avatars.githubusercontent.com/u/8237355?s=200\u0026v=4\" alt=\"Grav\" height=\"40\" width=\"40\"/\u003e \u003c/a\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp; \n\u003ca href=\"https://www.docker.com/\" target=\"_blank\" rel=\"noreferrer\"\u003e \u003cimg src=\"https://raw.githubusercontent.com/github/explore/80688e429a7d4ef2fca1e82350fe8e3517d3494d/topics/docker/docker.png\" alt=\"docker\" width=\"40\" height=\"40\" width=\"40\"/\u003e \u003c/a\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp; \n\u003ca href=\"https://www.apache.org\" target=\"_blank\" rel=\"noreferrer\"\u003e \u003cimg src=\"https://avatars.githubusercontent.com/u/47359?s=200\u0026v=4\" alt=\"apache2\" height=\"40\" width=\"40\"/\u003e \u003c/a\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp; \n\u003ca href=\"https://www.php.net\" target=\"_blank\" rel=\"noreferrer\"\u003e \u003cimg src=\"https://avatars.githubusercontent.com/u/25158?s=200\u0026v=4\" alt=\"php\" height=\"40\" width=\"40\"/\u003e \u003c/a\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp; \n\u003ca href=\"https://redis.io\" target=\"_blank\" rel=\"noreferrer\"\u003e \u003cimg src=\"https://avatars.githubusercontent.com/u/1529926?s=200\u0026v=4\" alt=\"redis\" height=\"40\" width=\"40\"/\u003e \u003c/a\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp; \n\u003ca href=\"#\" target=\"_blank\" rel=\"noreferrer\"\u003e \u003cimg src=\"https://raw.githubusercontent.com/github/explore/80688e429a7d4ef2fca1e82350fe8e3517d3494d/topics/bash/bash.png\" alt=\"Bash\" height=\"50\" width=\"50\" /\u003e \u003c/a\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;\n\u003ca href=\"https://certbot.eff.org/\" target=\"_blank\" rel=\"noreferrer\"\u003e \u003cimg src=\"https://avatars.githubusercontent.com/u/17889013?s=200\u0026v=4\" alt=\"certbot\" height=\"40\" width=\"40\"/\u003e \u003c/a\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp; \n\u003ca href=\"https://letsencrypt.org/\" target=\"_blank\" rel=\"noreferrer\"\u003e \u003cimg src=\"https://avatars.githubusercontent.com/u/9289019?s=200\u0026v=4\" alt=\"letsencrypt\" height=\"40\" width=\"40\"/\u003e \u003c/a\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp; \n\u003ca href=\"https://www.portainer.io/?hsLang=en\" target=\"_blank\" rel=\"noreferrer\"\u003e \u003cimg src=\"https://avatars.githubusercontent.com/u/22225832?s=200\u0026v=4\" alt=\"portainer\" height=\"40\" width=\"40\"/\u003e \u003c/a\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp; \n\u003ca href=\"https://www.offen.dev/\" target=\"_blank\" rel=\"noreferrer\"\u003e \u003cimg src=\"https://avatars.githubusercontent.com/u/47735043?s=200\u0026v=4\" alt=\"backup\" height=\"35\" width=\"35\"/\u003e \u003c/a\u003e \u003c/p\u003e\n\nPlus, manage docker containers with Portainer.\n\n#### Supported CPU architectures:\n\u003cp align=\"left\"\u003e arm64/aarch64, x86-64 \u003c/p\u003e\n\n#### Supported Linux Package Manage Systems:\n\u003cp align=\"left\"\u003e apk, dnf, yum, apt/apt-get, zypper, pacman \u003c/p\u003e\n \n#### Supported Linux Operation Systems:\n\u003cp align=\"left\"\u003e \u003ca href=\"https://alpinelinux.org/\" target=\"_blank\" rel=\"noreferrer\"\u003e \u003cimg src=\"https://avatars.githubusercontent.com/u/7600810?s=200\u0026v=4\" alt=\"alpine linux\" height=\"40\" width=\"40\"/\u003e \u003c/a\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp; \n\u003ca href=\"https://fedoraproject.org/\" target=\"_blank\" rel=\"noreferrer\"\u003e \u003cimg src=\"https://raw.githubusercontent.com/github/explore/e6b1e7f0fb8d0bf920bd719c7289243138bdc1b4/topics/fedora/fedora.png\" alt=\"fedora\" height=\"40\" width=\"40\"/\u003e \u003c/a\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp; \n\u003ca href=\"https://www.centos.org/\" target=\"_blank\" rel=\"noreferrer\"\u003e \u003cimg src=\"https://avatars.githubusercontent.com/u/79192?s=200\u0026v=4\" alt=\"centos\" height=\"40\" width=\"40\"/\u003e \u003c/a\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp; \n\u003ca href=\"https://www.debian.org/\" target=\"_blank\" rel=\"noreferrer\"\u003e \u003cimg src=\"https://avatars.githubusercontent.com/u/1854028?s=200\u0026v=4\" alt=\"debian\" height=\"40\" width=\"40\"/\u003e \u003c/a\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp; \n\u003ca href=\"https://ubuntu.com/\" target=\"_blank\" rel=\"noreferrer\"\u003e \u003cimg src=\"https://avatars.githubusercontent.com/u/4604537?s=200\u0026v=4\" alt=\"ubuntu\" height=\"40\" width=\"40\"/\u003e \u003c/a\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp; \n\u003ca href=\"https://www.raspberrypi.com/\" target=\"_blank\" rel=\"noreferrer\"\u003e \u003cimg src=\"https://avatars.githubusercontent.com/u/1294177?s=200\u0026v=4\" alt=\"ubuntu\" height=\"40\" width=\"40\"/\u003e \u003c/a\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp; \n\u003ca href=\"https://www.redhat.com/en/technologies/linux-platforms/enterprise-linux\" target=\"_blank\" rel=\"noreferrer\"\u003e \u003cimg src=\"https://avatars.githubusercontent.com/u/33972111?s=200\u0026v=4\" alt=\"redhat on s390x (IBM Z)\" height=\"40\" width=\"40\"/\u003e \u003c/a\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp; \n\u003ca href=\"https://www.suse.com/products/server/\" target=\"_blank\" rel=\"noreferrer\"\u003e \u003cimg src=\"https://avatars.githubusercontent.com/u/623819?s=200\u0026v=4\" alt=\"opensuse on s390x (IBM Z)\" height=\"40\" width=\"40\"/\u003e \u003c/a\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp; \n\u003ca href=\"https://archlinux.org/\" target=\"_blank\" rel=\"noreferrer\"\u003e \u003cimg src=\"https://gitlab.archlinux.org/uploads/-/system/group/avatar/23/iconfinder_archlinux_386451.png?width=48\" alt=\"arch linux\" height=\"40\" width=\"40\"/\u003e \u003c/a\u003e \u003c/p\u003e\n\n##### Note: Fedora 37, 39 and alpine linux x86-64 compatible, could not try sles IBM Z s390x, rhel IBM Z s390x and raspberrypi.\n\n#### With this project you can quickly run the following:\n\n- [Grav](https://github.com/getgrav) - [php-fpm](https://hub.docker.com/_/php?tab=tags\u0026page=1\u0026name=fpm)\n- [webserver (apache2/httpd)](https://hub.docker.com/_/httpd)\n- [certbot (letsencrypt)](https://hub.docker.com/r/certbot/certbot)\n- [redis](https://hub.docker.com/_/redis)\n- [backup](https://hub.docker.com/r/offen/docker-volume-backup)\n\n#### For certbot (letsencrypt) certificate:\n\n- [Set DNS configuration of your domain name](https://support.google.com/a/answer/48090?hl=en)\n\n#### IPv4/IPv6 Firewall\nCreate rules to open ports to the internet, or to a specific IPv4 address or range.\n\n- http: 80\n- https: 443\n- portainer: 9001\n\n#### Contents:\n\n- [Auto Configuration and Installation](#automatic)\n- [Requirements](#requirements)\n- [Manual Configuration and Installation](#manual)\n- [Portainer Installation](#portainer)\n- [Usage](#usage)\n\t- [Website](#website)\n\t- [Webserver](#webserver)\n\t- [Database](#database)\n\t- [Redis](#redis)\n\t- [Cache](#cache)\n\t- [backup](#backup)\t\t\t\t\t  \n\n## Automatic\n\n### Exec install shell script for auto installation and configuration\n\ndownload with\n\n```\ngit clone https://github.com/damalis/full-stack-apache2-grav-for-everyone-with-docker-compose.git\n```\n\nOpen a terminal and `cd` to the folder in which `docker-compose.yml` is saved and run:\n\n```\ncd full-stack-apache2-grav-for-everyone-with-docker-compose\nchmod +x install.sh\n./install.sh\n```\n\n## Requirements\n\nMake sure you have the latest versions of **Docker** and **Docker Compose** installed on your machine.\n\n- [How install docker](https://docs.docker.com/engine/install/)\n- [How install docker compose](https://docs.docker.com/compose/install/)\n\nClone this repository or copy the files from this repository into a new folder.\n\nMake sure to [add your user to the `docker` group](https://docs.docker.com/install/linux/linux-postinstall/#manage-docker-as-a-non-root-user).\n\n## Manual\n\n### Configuration\n\ndownload with\n\n```\ngit clone https://github.com/damalis/full-stack-apache2-grav-for-everyone-with-docker-compose.git\n```\n\nOpen a terminal and `cd` to the folder in which `docker-compose.yml` is saved and run:\n\n```\ncd full-stack-apache2-grav-for-everyone-with-docker-compose\n```\n\nCopy the example environment into `.env`\n\n```\ncp env.example .env\n```\n\nEdit the `.env` file to change values of ```LOCAL_TIMEZONE```, ```DOMAIN_NAME```, ```DIRECTORY_PATH``` and ```LETSENCRYPT_EMAIL```.\n\nLOCAL_TIMEZONE=[to see local timezones](https://docs.diladele.com/docker/timezones.html)\n\nDIRECTORY_PATH=```pwd``` at command line\\\nSSL_SNIPPET=```echo 'Generated Self-signed SSL Certificate for localhost'``` for localhost\\\nSSL_SNIPPET=```certbot certonly --webroot --webroot-path /tmp/acme-challenge --rsa-key-size 4096 --non-interactive --agree-tos --no-eff-email --force-renewal --email ${LETSENCRYPT_EMAIL} -d ${DOMAIN_NAME} -d www.${DOMAIN_NAME}``` for remotehost\n\n### Installation\n\nFirstly: will create external volume\n\n```\ndocker volume create --driver local --opt type=none --opt device=${PWD}/certbot --opt o=bind certbot-etc\n```\n\nfor localhost ssl: Generate Self-signed SSL Certificate with guide [mkcert repository](https://github.com/FiloSottile/mkcert).\n\n```\ndocker compose up -d\n```\n\nthen reloading for webserver ssl configuration\n\n```\ndocker container restart webserver\n```\n\nThe containers are now built and running. You should be able to access the Grav installation with the configured IP in the browser address. `https://example.com`.\n\nFor convenience you may add a new entry into your hosts file.\n\n## Portainer\n\n```\ndocker compose -f portainer-docker-compose.yml -p portainer up -d \n```\nmanage docker with [Portainer](https://www.portainer.io/) is the definitive container management tool for Docker, Docker Swarm with it's highly intuitive GUI and API. \n\nYou can also visit `https://example.com:9001` to access portainer after starting the containers.\n\n## Usage\n\n#### You could manage docker containers without command line with portainer.\n\n### Show both running and stopped containers\n\nThe docker ps command only shows running containers by default. To see all containers, use the -a (or --all) flag:\n\n```\ndocker ps -a\n```\n\n### Starting containers\n\nYou can start the containers with the `up` command in daemon mode (by adding `-d` as an argument) or by using the `start` command:\n\n```\ndocker compose start\n```\n\n### Stopping containers\n\n```\ndocker compose stop\n```\n\n### Removing containers\n\nTo stop and remove all the containers use the `down` command:\n\n```\ndocker compose down\n```\n\nto remove portainer and the other containers\n\n```\ndocker rm -f $(docker ps -a -q)\n```\n\nUse `-v` if you need to remove the database volume which is used to persist the database:\n\n```\ndocker compose down -v\n```\n\nto remove external certbot-etc and portainer and the other volumes\n\n```\ndocker volume rm $(docker volume ls -q)\n```\n\nDelete all images, containers, volumes, and networks that are not associated with a container (dangling):\n\n```\ndocker system prune\n```\n\nTo additionally remove any stopped containers and all unused images (not just dangling ones), add the -a flag to the command:\n\n```\ndocker system prune -a\n```\n\nto remove portainer and the other images\n\n```\ndocker rmi $(docker image ls -q)\n```\n\n### Project from existing source\n\nCopy all files into a new directory:\n\nYou can now use the `up` command:\n\n```\ndocker compose up -d\n```\n\n### Docker run reference\n\n[https://docs.docker.com/engine/reference/run/](https://docs.docker.com/engine/reference/run/)\n\n### Website\n\nYou should see the \"GRAV\" page in your browser. If not, please check if your PHP installation satisfies Grav's requirements.\n\n```\nhttps://example.com\n```\n\nadd or remove code in the ./php-fpm/php/conf.d/security.ini file for custom php.ini configurations\n\n[https://www.php.net/manual/en/configuration.file.php](https://www.php.net/manual/en/configuration.file.php)\n\nYou should make changes custom host configurations ```./php-fpm/php-fpm.d/z-www.conf``` then must restart service, FPM uses php.ini syntax for its configuration file - php-fpm.conf, and pool configuration files.\n\n[https://www.php.net/manual/en/install.fpm.configuration.php](https://www.php.net/manual/en/install.fpm.configuration.php)\n\n```\ndocker container restart grav\n```\n\nadd and/or remove grav site folders and files with any ftp client program in ```./grav``` folder.\n\u003cbr /\u003eYou can also visit `https://example.com` to access website after starting the containers.\n\n#### Webserver\n\nadd or remove code in the ```./webserver/extra/httpd-ssl.conf``` file for custom apache2/httpd configurations\n\n[https://httpd.apache.org/docs/2.4/](https://httpd.apache.org/docs/2.4/)\n\n#### Database\n\nBecause Grav is a flat-file based CMS, meaning no database underpins it, the folder structure of your site is very important. \nAt the top level of your Grav installation the folder structure looks like:\n\n```\n/assets\n/backup\n/bin\n/cache\n/images\n/logs\n/system\n/tmp\n/vendor\n/user\n```\n\n[https://learn.getgrav.org/17/basics/folder-structure](https://learn.getgrav.org/17/basics/folder-structure)\n\n#### Redis\n\nThese options should go under the cache: group in your ```./grav/user/config/system.yaml```:\n\n```\ncache:\n  ...\n  redis:\n    server: redis\n    port: 6379\n```\n\n[https://learn.getgrav.org/17/advanced/performance-and-caching#redis-specific-options](https://learn.getgrav.org/17/advanced/performance-and-caching#redis-specific-options)\n\n#### Cache\n\nThe Cache section is where you can configure the site's caching settings. You can enable, disable, choose the method, and more.\n\n[https://learn.getgrav.org/17/basics/grav-configuration#cache](https://learn.getgrav.org/17/basics/grav-configuration#cache)\n\n### backup\n\nThis will back up the all files and folders in html volumes, once per day, and write it to ./backups with a filename like backup-2023-01-01T10-18-00.tar.gz\n\n#### can run on a custom cron schedule\n\n```BACKUP_CRON_EXPRESSION: '20 01 * * *'``` the UTC timezone.\n","funding_links":["https://github.com/sponsors/damalis"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdamalis%2Ffull-stack-apache2-grav-for-everyone-with-docker-compose","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdamalis%2Ffull-stack-apache2-grav-for-everyone-with-docker-compose","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdamalis%2Ffull-stack-apache2-grav-for-everyone-with-docker-compose/lists"}