{"id":12758,"date":"2025-07-15T06:10:13","date_gmt":"2025-07-15T06:10:13","guid":{"rendered":"https:\/\/www.bacancytechnology.com\/qanda\/?p=12758"},"modified":"2025-07-30T10:00:29","modified_gmt":"2025-07-30T10:00:29","slug":"configure-nextcloud-fpm-docker-compose-with-bare-metal-nginx","status":"publish","type":"post","link":"https:\/\/www.bacancytechnology.com\/qanda\/cloud\/configure-nextcloud-fpm-docker-compose-with-bare-metal-nginx","title":{"rendered":"How to Configure Nextcloud-fpm docker-compose With Bare Metal Nginx"},"content":{"rendered":"<p>This guide outlines how to deploy<strong> Nextcloud-FPM<\/strong> using Docker Compose and connect it to a <strong>bare metal NGINX reverse proxy<\/strong> running on the host system.<\/p>\n<h2>1. Docker Compose Configuration<\/h2>\n<p>Create a file named docker-compose.yml:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"dart\">\r\nversion: '3.7'\r\nservices:\r\n  nextcloud:\r\n    image: nextcloud:fpm\r\n    container_name: nextcloud-app\r\n    restart: always\r\n    volumes:\r\n      - nextcloud_data:\/var\/www\/html\r\n    environment:\r\n      - MYSQL_PASSWORD=your_db_password\r\n      - MYSQL_DATABASE=nextcloud\r\n      - MYSQL_USER=nextcloud\r\n      - MYSQL_HOST=db\r\n      - REDIS_HOST=redis\r\n    ports:\r\n      - \"9000:9000\"\r\n  db:\r\n    image: mariadb:10.6\r\n    container_name: nextcloud-db\r\n    restart: always\r\n    environment:\r\n      - MYSQL_ROOT_PASSWORD=your_root_password\r\n      - MYSQL_PASSWORD=your_db_password\r\n      - MYSQL_DATABASE=nextcloud\r\n      - MYSQL_USER=nextcloud\r\n    volumes:\r\n      - db_data:\/var\/lib\/mysql\r\n  redis:\r\n    image: redis:alpine\r\n    container_name: nextcloud-redis\r\n    restart: always\r\nvolumes:\r\n  nextcloud_data:\r\n  db_data:\r\n<\/pre>\n<h2>2. NGINX Reverse Proxy Configuration<\/h2>\n<p>Create a file at \/etc\/nginx\/sites-available\/nextcloud:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"dart\">\r\nserver {\r\n    listen 80;\r\n    server_name yourdomain.com;\r\n\r\n    root \/var\/www\/nextcloud;\r\n    client_max_body_size 512M;\r\n\r\n    location \/ {\r\n        proxy_pass http:\/\/127.0.0.1:9000;\r\n        include fastcgi_params;\r\n        fastcgi_pass 127.0.0.1:9000;\r\n        fastcgi_param SCRIPT_FILENAME \/var\/www\/nextcloud\/index.php;\r\n        fastcgi_param PATH_INFO $fastcgi_path_info;\r\n        fastcgi_index index.php;\r\n    }\r\n\r\n    location ~ ^(.+\\.php)(.*)$ {\r\n        root \/var\/www\/nextcloud;\r\n        include fastcgi_params;\r\n        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;\r\n        fastcgi_param PATH_INFO $2;\r\n        fastcgi_pass 127.0.0.1:9000;\r\n    }\r\n\r\n    location ~* \\.(?:jpg|jpeg|gif|bmp|ico|png|css|js|svg|woff|woff2|ttf|eot|otf|ogg|mp4|webm|wav|mp3)$ {\r\n        try_files $uri \/index.php$request_uri;\r\n        access_log off;\r\n        expires 30d;\r\n    }\r\n}\r\n<\/pre>\n<h3>Enable the Site and Reload NGINX<\/h3>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"dart\">\r\nsudo ln -s \/etc\/nginx\/sites-available\/nextcloud \/etc\/nginx\/sites-enabled\/\r\nsudo nginx -t\r\nsudo systemctl reload nginx\r\n<\/pre>\n<div class=\"qanda-read-box\"><div class=\"bg-light read-more-icon\"><img decoding=\"async\" src=\"https:\/\/assets.bacancytechnology.com\/qanda\/wp-content\/uploads\/2025\/04\/24061434\/read-txt.png\" alt=\"Also Read\"><p><\/p><h3>Also Read:<\/h3><a href=\"https:\/\/www.bacancytechnology.com\/blog\/cloud-maturity-model\" target=\"_blank\">Cloud Maturity Model<\/a><\/div><\/div>\n","protected":false},"excerpt":{"rendered":"<p>This guide outlines how to deploy Nextcloud-FPM using Docker Compose and connect it to a bare metal NGINX reverse proxy running on the host system. 1. Docker Compose Configuration Create a file named docker-compose.yml: version: &#8216;3.7&#8217; services: nextcloud: image: nextcloud:fpm container_name: nextcloud-app restart: always volumes: &#8211; nextcloud_data:\/var\/www\/html environment: &#8211; MYSQL_PASSWORD=your_db_password &#8211; MYSQL_DATABASE=nextcloud &#8211; MYSQL_USER=nextcloud &#8211; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":12760,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[17],"tags":[],"class_list":["post-12758","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cloud"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.bacancytechnology.com\/qanda\/wp-json\/wp\/v2\/posts\/12758"}],"collection":[{"href":"https:\/\/www.bacancytechnology.com\/qanda\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.bacancytechnology.com\/qanda\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.bacancytechnology.com\/qanda\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bacancytechnology.com\/qanda\/wp-json\/wp\/v2\/comments?post=12758"}],"version-history":[{"count":3,"href":"https:\/\/www.bacancytechnology.com\/qanda\/wp-json\/wp\/v2\/posts\/12758\/revisions"}],"predecessor-version":[{"id":12937,"href":"https:\/\/www.bacancytechnology.com\/qanda\/wp-json\/wp\/v2\/posts\/12758\/revisions\/12937"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.bacancytechnology.com\/qanda\/wp-json\/wp\/v2\/media\/12760"}],"wp:attachment":[{"href":"https:\/\/www.bacancytechnology.com\/qanda\/wp-json\/wp\/v2\/media?parent=12758"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bacancytechnology.com\/qanda\/wp-json\/wp\/v2\/categories?post=12758"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bacancytechnology.com\/qanda\/wp-json\/wp\/v2\/tags?post=12758"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}