README.md 3.44 KB
Newer Older
Vincent Sellier's avatar
Vincent Sellier committed
1
2
3
4
# Simplified self-hosted cozy cloud installation

:warning: Unofficial, not affiliated with cozy.io

i-vall's avatar
i-vall committed
5
Simplified procedure to run a personal cozy cloud with GrandLyon apps with docker.
Vincent Sellier's avatar
Vincent Sellier committed
6

i-vall's avatar
i-vall committed
7
Derived from vsellier's [easy-cozy](https://github.com/vsellier/easy-cozy).
Vincent Sellier's avatar
Vincent Sellier committed
8
9
10
11
12
13
14
15
16
17
18
19
20

## Prequisite

- A domain name
- A server with docker installed (linux **arm** or x86, MacOS) and accessible from Internet

## Domain configuration

Choose a cozy subdomain for you instance like `cozy.mydomain.tld`. Declare on your domain :

- a `A` entry with the ip of your server to `cozy.mydomain.tld`
- a `CNAME` entry `*.cozy.mydomain.tld` to `cozy.mydomain.tld`

Nicolas PERNOUD's avatar
Nicolas PERNOUD committed
21
22
23
## Reverse proxy configuration

The deployed cozy installation is not ready for web yet, it need to be exposed to the web through a reverse proxy. As cozy generates sub-domains for every applications, Let's Encrypt certificates must be generated dynamically.
24
[Vestibule](https://github.com/nicolaspernoud/Vestibule) can be easily used to do so. Traefik can also be used, but if you want to do so, consider using the upfront vsellier's [easy-cozy](https://github.com/vsellier/easy-cozy).
Nicolas PERNOUD's avatar
Nicolas PERNOUD committed
25

26
27
28
29
30
31
## OIDC

This installation creates an normal account named "demo", and an Open Id Connect (OIDC) authenticated account named "demooidc".
The docker-compose starts a keycloak instance that must be accessible under the url defined in OIDC_IDP environment variable (use webfront+ to reverse proxy it) as well.
If you do not want to use OICD, you can remove keycloak from the docker compose and delete the demooidc instance.

Vincent Sellier's avatar
Vincent Sellier committed
32
33
## Cozy installation and configuration

34
- Clone the [easy-cozy](https://forge.grandlyon.com/pocs/cozy/easy-cozy) project
Vincent Sellier's avatar
Vincent Sellier committed
35

i-vall's avatar
i-vall committed
36
```sh
37
git clone https://forge.grandlyon.com/pocs/cozy/easy-cozy.git
Vincent Sellier's avatar
Vincent Sellier committed
38
39
```

i-vall's avatar
i-vall committed
40
- On the root directory of the project, create a `.env` file. You can use the [env.template](env.template) file as reference.
Vincent Sellier's avatar
Vincent Sellier committed
41

42
- By default, your first instance is named 'demo'. To change it, open the [install.sh](install.sh) script and modify the line where `create-instance.sh` is called.
Vincent Sellier's avatar
Vincent Sellier committed
43

i-vall's avatar
i-vall committed
44
- Start the server for the first time
Vincent Sellier's avatar
Vincent Sellier committed
45

i-vall's avatar
i-vall committed
46
47
```sh
sudo ./install.sh
Vincent Sellier's avatar
Vincent Sellier committed
48
```
49

i-vall's avatar
i-vall committed
50
51
This will start the containers, create the databases and create an instance with basic applications.
Open in a browser the url displayed at the end of the script output to finalize the instance configuration.
Vincent Sellier's avatar
Vincent Sellier committed
52

i-vall's avatar
i-vall committed
53
:+1: Congratulations you have now your own cozy cloud.
Vincent Sellier's avatar
Vincent Sellier committed
54

i-vall's avatar
i-vall committed
55
## Initialize more personal instance(s)
Vincent Sellier's avatar
Vincent Sellier committed
56

i-vall's avatar
i-vall committed
57
To add an instance `myuser.cozy.mydomain.tld`, run:
Vincent Sellier's avatar
Vincent Sellier committed
58

i-vall's avatar
i-vall committed
59
60
```sh
sudo ./create-instance.sh myuser
Vincent Sellier's avatar
Vincent Sellier committed
61
62
63
64
```

Open in a browser the url displayed at the end of the script output to finalize the instance configuration.

65
66
## Install applications

i-vall's avatar
i-vall committed
67
Default apps (drive, collect, settings, home) and GrandLyon apps (energy-dataviz) are installed by default by the [create-instance.sh](create-instance.sh) script. Other applications like [banks](https://github.com/cozy/cozy-banks) or [contacts](https://github.com/cozy/cozy-contacts) are also available.
68

69
You can go to the store application (`store.yourinstance.youdomain.tld`) to manage you applications.
70
To manually install an application, you can run the [application.sh](application.sh) script :
71

i-vall's avatar
i-vall committed
72
```sh
73
74
sudo ./application.sh <instance name> <application>
```
i-vall's avatar
i-vall committed
75
76
77
78
79
80
81
82
83

## Update applications

To update Grand Lyon applications and connectors, run:

```sh
sudo ./update.sh
```

i-vall's avatar
i-vall committed
84
## Reset your cozy
i-vall's avatar
i-vall committed
85

i-vall's avatar
i-vall committed
86
If for some reason you need to reset your cozy, simply re-run [install.sh](install.sh).
87
Careful, all the data and instances will be removed and you will have a new, clean cozy with basic apps.