Code Monkey home page Code Monkey logo

nextcloud-docker's Introduction

Nextcloud: a safe home for all your data

Motivation

My initial goal when starting this project was to move all my sensitive data from Google Drive to a self-hosted Nextcloud instance.

Deploying Nextcloud on Docker was an evidence since I already had some experience with it, I though it would be rather straightforward to deploy a nextcloud instance with a reverse proxy and HTTPS support to securely access my data everywhere in a secure way.

But it was not that easy, mainly because of permission issues regarding shared volumes between the fpm and the nginx container and the examples provided were not satisfying because I intended to deploy Nextcloud on a swarm stack.

The system is now stable and can survive a reboot.

Installation

  1. Ensure that you have docker configured in swarm mode.

    docker swarm init
    

    on the master node.

  2. Ensure that you have Traefik configured as a reverse proxy (recommended).

    /!\ Do only work with traefik < 2.0. The newer version of traefik uses routers and middleware to route queries which is incompatible in our stack definition here.

    I used traefik as a reverse proxy as the acme challenge with let's encrypt is built-in and really handy. This is not a mandatory step, you can expose container port and access your instance directly but I would not recommend it.

  3. Copy the required files and fill your details:

    cp configs.yaml.sample configs.yaml
    cp db.env.sample db.env
    

    configs.yaml: allow to custom your instance

    ---
    domain: "localhost.localdomain"
    registry: <YOUR_REGISTRY_URL_HERE>
    fpm:
      version: 0.1
    proxy:
      version: 0.1
    

    The version variable here is just to track your modification made on your fpm and proxy instance. For example, I'm using a private registry such that each change is track and I can rollback to a previous change if anything go wrong. I can that way rebuild the exact same stack every time. Even if Nextcloud decide to update the image I'm using as a base, this will not impact me/you as the image is already built and store in my/your registry.

    db.env: database name and credentials. Make sure to use a strong password.

  4. Deploy the nextcloud stack.

    make deploy
    
    

The stack should now be deployed, don't hesitate to open a PR and I'll gladly support you on this stack.

If you want to remove the containers (i.e restart), issue make remove

nextcloud-docker's People

Contributors

lion24 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.