Code Monkey home page Code Monkey logo

encrypted-hetzner-cloud-with-nextcloud's Introduction

Guide

Create Server

Add Volume

Choose Volume

Install own image

Mount

Choose Volume

Open console and restart

Choose language, country and keyboard layout

Choose language, country and keyboard layout

Skip network config

Skip network config Skip network config

Setup encrypted lvm

Setup encrypted partition Setup encrypted partition Setup encrypted partition

Rest of installation

Rest of installation Rest of installation Rest of installation Rest of installation

At this point unmount the image in the cloud control panel and then hit enter in the terminal.

Enter passphrase on boot

Rest of installation

Setup networking

Edit /etc/netplan/01-netcfg.yaml and add the following part:

network:
   version: 2
   renderer: networkd
   ethernets:
       ens3:
           addresses:
               - <ip6-address-copied-from-panel>::1/64
           dhcp4: true
           gateway6: fe80::1

After saving apply the netplan:

netplan apply

Now try to ping an ip outside of your box:

ping 1.1.1.1

Encrypt volume and setup file system

Set volume as encrypted:

cryptsetup -y -v luksFormat /dev/sdb

Encrypt volume

Create random key for your volume and set proper permissions:

dd if=/dev/urandom of=/etc/volume-secret-key bs=512 count=8
chmod 0600 /etc/volume-secret-key

Encrypt volume

Add your key file to your volume as an ecryption key:

cryptsetup -v luksAddKey /dev/sdb /etc/volume-secret-key

Encrypt volume

To be able to automatically mount your encrypted volume you first need to get the UUID of your volume:

cryptsetup luksDump /dev/sdb | grep "UUID"

Encrypt volume

Now you need to edit /etc/crypttab and add the following entry for your volume:

volume UUID=3530a1c8-9de4-4c68-b674-9d9e88ab6e0d /etc/volume-secret-key luks

After doing that you are already able to start the encrypted volume:

cryptdisks_start volume

Encrypt volume

Install pv to see progress on the next step when clearing the volume:

apt-get update && apt-get install pv

Then clear the volume (this might take a few minutes depending on the size of the volume):

pv -tpreb /dev/zero | dd of=/dev/mapper/volume bs=128M

Clear volume

Now you can create the file system on top of the encrypted volume:

mkfs.ext4 /dev/mapper/volume

Filesystem

After that create a mount folder for the volume ...:

mkdir /mnt/volume

...and add the following line to /etc/fstab:

/dev/mapper/volume  /mnt/volume ext4    defaults    0   2

Filesystem

Now mount the encrypted volume with a swift:

mount -a

Installing Nextcloud

Install nextcloud and enable removable media:

snap install nextcloud
snap enable nextcloud
snap connect nextcloud:removable-media

Create a new data folder on your volume:

mkdir /mnt/volume/nextcloud

Update the config for nextcloud to use that new folder:

    nano /var/snap/nextcloud/current/nextcloud/config/config.php

data directory

Disable nextcloud, move over all files, if there are already any and enable it again:

snap disable nextcloud
mv /var/snap/nextcloud/common/nextcloud/data/* /mnt/volume/nextcloud
snap enable nextcloud

For further configuration visit https://manandkeyboard.tk/2018/01/07/nextcloud-snap-installation/

After that you can open up your browser and navigate to your server's ip:

setup

encrypted-hetzner-cloud-with-nextcloud's People

Contributors

rinukkusu 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.