Coder Social home page Coder Social logo

rpi-owncloud's Introduction

Owncloud on RPI

Instructions for how to set up a Owncloud instance on Docker using a Raspberry Pi.

Target: arm32 based Raspberry Pi 3B running Raspbian. 1 GB ram.

graph TD
    a[User] --> |https://yourowncloud.example.com/fileshare|b[Nginx];
    b --> |http://localip:8088| c[Owncloud];
    c --> |CIFS/SMB| d[(Your Owncloud Files)]
Loading

Docker

Install Docker on the Pi Link

Portainer

Install Portainer to manage Docker containers. Link

Owncloud

Volumes

Note: This guide assumes you have a SAMBA file share on the local network. This share will be used to store the Owncloud files.

Create the volume. Run below in the command line:

docker volume create -d local --opt type=cifs --opt device=//192.168.1.1/<<PATH TO YOUR SHARE>> --opt 'o=addr=192.168.1.1,username=<<USERNAME>>,password=<<PASSWORD>>,vers=2.0,uid=33,forceuid,file_mode=0770,dir_mode=0770' owncloud_custom_files_noperm

Note: The container uses uid=33 as the www-data user. Permissions will not work if this is not added.

Stack

In Portainer Stacks, deploy the Docker file in ./owncloud. Change the environment username/password. This stack was modified from Owncloud's install to run on arm32.

The Owncloud web-server will now run at http://localhost:8088

Nginx Proxy Manager

Nginx will serve as the https front-end for external clients.

Volumes

There are no volumes for this container. Data paths are binded directly to the host-filesystem. This guide puts the container's data and letsencrypt folders in the home directory of your host user. The path is configured in the environment variable.

Stack

In Portainer Stacks, deploy the Docker file in ./nginx-proxy-manager.

The Nginx admin panel will now be accessible at http://localhost:81. The front-end of the Nginx server will now be accessible at http://localhost:80 and https://localhost:443.

Proxy Configuration

Navigate to the Nginx admin panel.

Create an SSL cert

Create a cert for your hostname.

Create a new host:

**Details**
Domain Names: <your domain>
Scheme: http
Forward Hostname: your RPI's internal IP address or hostname
Forwarded Port: 8088
Block Common Exploits: True

**SSL**
SSL Certificate: <your cert>
Force SSL: True
HSTS Enabled: True

**Advanced**
Custom Nginx config: See below. This will block the redirect from the root host to Owncloud. This will limit access from crawlers and bots as they will need to know the full server path.
    location =/ {
        return 403;
    }
    proxy_connect_timeout 300;
    proxy_send_timeout 300;
    proxy_read_timeout 300;
    send_timeout 300;

ddclient

ddclient is a dynamic dns (DDNS) service to update the IP address for your hostname.

Volumes

There are no volumes for this container. Data paths are binded directly to the host-filesystem. This guide puts the container's data in the home directory of your host user, under the ddclient folder.

Stack

In Portainer Stacks, deploy the Docker file in ./ddclient.

Config

ddclient needs to connect to your DNS registrar to update the IP records. This documentation uses Namecheap as a guide.

Navigate to ~/ddclient on your RPI and open ddclient.conf. Change the setting for Namecheap to below. Only change things in <<brackets>>

##
## NameCheap (namecheap.com)
##
 use=web, web=dynamicdns.park-your-domain.com/getip
 protocol=namecheap,                            \
 server=dynamicdns.park-your-domain.com,        \
 login=<<example.org>>,                                 \
 password=<<pwd>>      \
 <<subdomain, e.g. www>>

crontab-rsync

An image that runs rsync on a schedule using cron. Useful to sync directories for backups of the Owncloud data.

See https://hub.docker.com/repository/docker/urdaalex/crontab-rsync for more details.

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.