mailcow/docs/install.md

79 lines
2.1 KiB
Markdown
Raw Normal View History

2017-03-02 18:23:23 +08:00
# Install mailcow
1. You need Docker.
2017-03-03 04:43:08 +08:00
Most systems can install Docker by running `wget -qO- https://get.docker.com/ | sh`.
2017-03-02 18:23:23 +08:00
2017-03-03 03:11:48 +08:00
2. You need Docker Compose
2017-03-03 04:43:08 +08:00
Learn [how to install Docker Compose](https://docs.docker.com/compose/install/).
2017-03-02 18:23:23 +08:00
2017-03-03 03:11:48 +08:00
3. Clone the master branch of the repository
2017-03-03 04:43:08 +08:00
```
git clone https://github.com/andryyy/mailcow-dockerized && cd mailcow-dockerized
```
2017-03-02 18:23:23 +08:00
2017-03-03 03:11:48 +08:00
4. Generate a configuration file. Use a FQDN (`host.domain.tld`) as hostname when asked.
2017-03-03 04:43:08 +08:00
```
./generate_config.sh
```
2017-03-02 18:23:23 +08:00
2017-03-03 03:11:48 +08:00
5. Change configuration if you want or need to.
2017-03-03 04:43:08 +08:00
```
nano mailcow.conf
```
2017-03-02 18:23:23 +08:00
2017-03-03 03:11:48 +08:00
If you plan to use a reverse proxy, you can, for example, bind HTTPS to 127.0.0.1 on port 8443 and HTTP to 127.0.0.1 on port 8080.
6. Run the composer file.
2017-03-03 04:43:08 +08:00
```
docker-compose up -d
```
2017-03-03 03:11:48 +08:00
Done!
2017-03-02 18:23:23 +08:00
You can now access **https://${MAILCOW_HOSTNAME}** with the default credentials `admin` + password `moohoo`.
It may take a while for MySQL to warm up, so please wait half a minute.
The database will be initialized right after a connection to MySQL can be established.
# Update mailcow
There is no update routine.
You need to refresh your pulled repository clone by running `git pull` - this will likely fail due to changes to your local configuration. But that's why we use git! :-)
Whatever file has local changes, add and commit it to your repository clone. For example:
```
git add data/conf/postfix/main.cf data/conf/dovecot/dovecot.conf
git commit -m "My changes to main.cf and dovecot.conf
```
Try running `git pull` again and resolve conflicts, if any.
Now update all images, apply changes to containers and restart all services:
```
docker-compose pull
docker-compose up -d --remove-orphans
docker-compose restart
```
2017-03-03 04:20:40 +08:00
## Development branch (not recommended)
2017-03-02 18:23:23 +08:00
2017-03-03 04:20:40 +08:00
When you checkout the "dev" git branch, you will most likely end up using the "master" images with code base of "dev".
2017-03-02 18:23:23 +08:00
If there were critical changes to the images in dev, mailcow will not work.
But you can still build the images by yourself:
```
docker-compose up -d --build
```