mailcow-dockerized-docs/site/install/index.html

512 Zeilen
17 KiB
HTML

2017-05-01 21:38:12 +02:00
<!DOCTYPE html>
<html class="no-js">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="shortcut icon" href="../assets/images/favicon.png">
<meta name="generator" content="mkdocs-0.16.1, mkdocs-material-1.2.0">
<title>Installation - mailcow: dockerized</title>
<script src="../assets/javascripts/modernizr-56ade86843.js"></script>
<link rel="stylesheet" href="../assets/stylesheets/application-e17eeafcbc.css">
<link rel="stylesheet" href="../assets/stylesheets/application-892b79c5c5.palette.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700|Roboto+Mono">
<style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style>
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
</head>
<body data-md-color-primary="indigo" data-md-color-accent="yellow">
<svg class="md-svg">
<defs>
<svg xmlns="http://www.w3.org/2000/svg" width="416" height="448" viewBox="0 0 416 448" id="github"><path fill="currentColor" d="M160 304q0 10-3.125 20.5t-10.75 19T128 352t-18.125-8.5-10.75-19T96 304t3.125-20.5 10.75-19T128 256t18.125 8.5 10.75 19T160 304zm160 0q0 10-3.125 20.5t-10.75 19T288 352t-18.125-8.5-10.75-19T256 304t3.125-20.5 10.75-19T288 256t18.125 8.5 10.75 19T320 304zm40 0q0-30-17.25-51T296 232q-10.25 0-48.75 5.25Q229.5 240 208 240t-39.25-2.75Q130.75 232 120 232q-29.5 0-46.75 21T56 304q0 22 8 38.375t20.25 25.75 30.5 15 35 7.375 37.25 1.75h42q20.5 0 37.25-1.75t35-7.375 30.5-15 20.25-25.75T360 304zm56-44q0 51.75-15.25 82.75-9.5 19.25-26.375 33.25t-35.25 21.5-42.5 11.875-42.875 5.5T212 416q-19.5 0-35.5-.75t-36.875-3.125-38.125-7.5-34.25-12.875T37 371.5t-21.5-28.75Q0 312 0 260q0-59.25 34-99-6.75-20.5-6.75-42.5 0-29 12.75-54.5 27 0 47.5 9.875t47.25 30.875Q171.5 96 212 96q37 0 70 8 26.25-20.5 46.75-30.25T376 64q12.75 25.5 12.75 54.5 0 21.75-6.75 42 34 40 34 99.5z"/></svg>
</defs>
</svg>
<input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="drawer">
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="search">
<label class="md-overlay" data-md-component="overlay" for="drawer"></label>
<header class="md-header">
<nav class="md-header-nav md-grid">
<div class="md-flex">
<div class="md-flex__cell md-flex__cell--shrink">
<a href=".." title="mailcow: dockerized" class="md-logo md-header-nav__button">
<img src="../images/logo.svg" width="24" height="24">
</a>
</div>
<div class="md-flex__cell md-flex__cell--shrink">
<label class="md-icon md-icon--menu md-header-nav__button" for="drawer"></label>
</div>
<div class="md-flex__cell md-flex__cell--stretch">
<span class="md-flex__ellipsis md-header-nav__title">
Installation
</span>
</div>
<div class="md-flex__cell md-flex__cell--shrink">
<label class="md-icon md-icon--search md-header-nav__button" for="search"></label>
<div class="md-search" data-md-component="search">
<div class="md-search__overlay"></div>
<div class="md-search__inner">
<form class="md-search__form" name="search">
<input type="text" class="md-search__input" name="query" placeholder="Search" accesskey="s" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query">
<label class="md-icon md-search__icon" for="search"></label>
</form>
<div class="md-search__output">
<div class="md-search__scrollwrap" data-md-scrollfix>
<div class="md-search-result" data-md-component="result"></div>
</div>
</div>
</div>
</div>
</div>
<div class="md-flex__cell md-flex__cell--shrink">
<div class="md-header-nav__source">
<a href="https://github.com/mailcow/mailcow-dockerized-docs" title="Go to repository" class="md-source" data-md-source="github">
<div class="md-source__icon">
<svg viewBox="0 0 24 24" width="24" height="24">
<use xlink:href="#github" width="24" height="24"></use>
</svg>
</div>
<div class="md-source__repository">
GitHub
</div>
</a>
</div>
</div>
</div>
</nav>
</header>
<div class="md-container">
<main class="md-main">
<div class="md-main__inner md-grid" data-md-component="container">
<div class="md-sidebar md-sidebar--primary" data-md-component="navigation">
<div class="md-sidebar__scrollwrap">
<div class="md-sidebar__inner">
<nav class="md-nav md-nav--primary" data-md-level="0">
<label class="md-nav__title md-nav__title--site" for="drawer">
<i class="md-logo md-nav__button">
<img src="../images/logo.svg">
</i>
mailcow: dockerized
</label>
<div class="md-nav__source">
<a href="https://github.com/mailcow/mailcow-dockerized-docs" title="Go to repository" class="md-source" data-md-source="github">
<div class="md-source__icon">
<svg viewBox="0 0 24 24" width="24" height="24">
<use xlink:href="#github" width="24" height="24"></use>
</svg>
</div>
<div class="md-source__repository">
GitHub
</div>
</a>
</div>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href=".." title="This is mailcow" class="md-nav__link">
This is mailcow
</a>
</li>
<li class="md-nav__item md-nav__item--active">
<input class="md-toggle md-nav__toggle" data-md-toggle="toc" type="checkbox" id="toc">
<a href="./" title="Installation" class="md-nav__link md-nav__link--active">
Installation
</a>
</li>
<li class="md-nav__item">
<a href="../first_steps/" title="First Steps" class="md-nav__link">
First Steps
</a>
</li>
<li class="md-nav__item">
<a href="../u_and_e/" title="Usage & Examples" class="md-nav__link">
Usage & Examples
</a>
</li>
</ul>
</nav>
</div>
</div>
</div>
<div class="md-sidebar md-sidebar--secondary" data-md-component="toc">
<div class="md-sidebar__scrollwrap">
<div class="md-sidebar__inner">
<nav class="md-nav md-nav--secondary">
<label class="md-nav__title" for="toc">Table of contents</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="#install-mailcow" title="Install mailcow" class="md-nav__link">
Install mailcow
</a>
</li>
<li class="md-nav__item">
<a href="#update-mailcow" title="Update mailcow" class="md-nav__link">
Update mailcow
</a>
<nav class="md-nav">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#step-1-method-1" title="Step 1, method 1" class="md-nav__link">
Step 1, method 1
</a>
</li>
<li class="md-nav__item">
<a href="#step-1-method-2" title="Step 1, method 2" class="md-nav__link">
Step 1, method 2
</a>
</li>
<li class="md-nav__item">
<a href="#step-1-method-3" title="Step 1, method 3" class="md-nav__link">
Step 1, method 3
</a>
</li>
<li class="md-nav__item">
<a href="#step-2" title="Step 2" class="md-nav__link">
Step 2
</a>
</li>
<li class="md-nav__item">
<a href="#step-3" title="Step 3" class="md-nav__link">
Step 3
</a>
</li>
</ul>
</nav>
</li>
</ul>
</nav>
</div>
</div>
</div>
<div class="md-content">
<article class="md-content__inner md-typeset">
<a href="https://github.com/mailcow/mailcow-dockerized-docs/edit/master/docs/install.md" title="Edit this page" class="md-icon md-content__edit">edit</a>
<h1>Installation</h1>
<h2 id="install-mailcow">Install mailcow<a class="headerlink" href="#install-mailcow" title="Permanent link">&para;</a></h2>
<p><strong>WARNING</strong>: Please use Ubuntu 16.04 instead of Debian 8 or <a href="https://packages.debian.org/jessie-backports/linux-image-amd64">switch to the kernel 4.9 from jessie backports</a> because there is a bug (kernel panic) with the kernel 3.16 when running docker containers with healthchecks! Full details here: <a href="https://github.com/docker/docker/issues/30402">github.com/docker/docker/issues/30402</a> and <a href="https://forum.mailcow.email/t/solved-mailcow-docker-causes-kernel-panic-edit/448">forum.mailcow.email/t/solved-mailcow-docker-causes-kernel-panic-edit/448</a></p>
<p>You need Docker and Docker Compose.</p>
<p>1. Learn how to install <a href="https://docs.docker.com/engine/installation/linux/">Docker</a> and <a href="https://docs.docker.com/compose/install/">Docker Compose</a>.</p>
<p>Quick installation for most operation systems:</p>
<ul>
<li>Docker</li>
</ul>
<div class="codehilite"><pre><span></span>curl -sSL https://get.docker.com/ | sh
</pre></div>
<ul>
<li>Docker-Compose</li>
</ul>
<div class="codehilite"><pre><span></span>curl -L https://github.com/docker/compose/releases/download/$(curl -Ls https://www.servercow.de/docker-compose/latest.php)/docker-compose-$(uname -s)-$(uname -m) &gt; /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
</pre></div>
<p>Please use the latest Docker engine available and do not use the engine that ships with your distros repository.</p>
<p>2. Clone the master branch of the repository</p>
<div class="codehilite"><pre><span></span>git clone https://github.com/andryyy/mailcow-dockerized &amp;&amp; cd mailcow-dockerized
</pre></div>
<p>3. Generate a configuration file. Use a FQDN (<code>host.domain.tld</code>) as hostname when asked.</p>
<div class="codehilite"><pre><span></span>./generate_config.sh
</pre></div>
<p>4. Change configuration if you want or need to.</p>
<div class="codehilite"><pre><span></span>nano mailcow.conf
</pre></div>
<p>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.</p>
<p>You may need to stop an existing pre-installed MTA which blocks port 25/tcp. See <a href="https://andryyy.github.io/mailcow-dockerized/first_steps/#install-a-local-mta">this chapter</a> to learn how to reconfigure Postfix to run besides mailcow after a successful installation.</p>
<p>5. Pull the images and run the composer file. The paramter <code>-d</code> will start mailcow: dockerized detached:</p>
<div class="codehilite"><pre><span></span>docker-compose pull
docker-compose up -d
</pre></div>
<p>Done!</p>
<p>You can now access <strong>https://${MAILCOW_HOSTNAME}</strong> with the default credentials <code>admin</code> + password <code>moohoo</code>.</p>
<p>The database will be initialized right after a connection to MySQL can be established.</p>
<h2 id="update-mailcow">Update mailcow<a class="headerlink" href="#update-mailcow" title="Permanent link">&para;</a></h2>
<p>There is no update routine. You need to refresh your pulled repository clone and apply your local changes (if any). Actually there are many ways to merge local changes.</p>
<h3 id="step-1-method-1">Step 1, method 1<a class="headerlink" href="#step-1-method-1" title="Permanent link">&para;</a></h3>
<p>Stash all local changes, pull changes from the remote master branch and apply your stash on top of it. You will most likely see warnings about non-commited changes; you can ignore them:</p>
<div class="codehilite"><pre><span></span># Stash local changes
git stash
# Re-pull master
git pull
# Apply stash and remove it
git stash pop
</pre></div>
<h3 id="step-1-method-2">Step 1, method 2<a class="headerlink" href="#step-1-method-2" title="Permanent link">&para;</a></h3>
<p>Fetch new data from GitHub, commit changes and merge remote repository: </p>
<div class="codehilite"><pre><span></span># Get updates/changes
git fetch
# Add all changed files to local clone
git add -A
# Commit changes, ignore git complaining about username and mail address
git commit -m &quot;Local config aat $(date)&quot;
# Merge changes
git merge
</pre></div>
<p>If git complains about conflicts, solve them! Example:</p>
<div class="codehilite"><pre><span></span>CONFLICT (content): Merge conflict in data/web/index.php
</pre></div>
<p>Open <code>data/web/index.php</code>, solve the conflict, close the file and run <code>git add -A</code> + <code>git commit -m "Solved conflict"</code>.</p>
<h3 id="step-1-method-3">Step 1, method 3<a class="headerlink" href="#step-1-method-3" title="Permanent link">&para;</a></h3>
<p>Thanks to fabreg @ GitHub!</p>
<p>In case both methods do not work (for many reason like you're unable to fix the CONFLICTS or any other reasons) you can simply start all over again.</p>
<p>Keep in mind that all local changes <em>to configuration files</em> will be lost. However, your volumes will not be removed.</p>
<ul>
<li>Copy mailcow.conf somewhere outside the mailcow-dockerized directory</li>
<li>Stop and remove mailcow containers: <code>docker-compose down</code></li>
<li>Delete the directory or rename it</li>
<li>Clone the remote repository again (<code>git clone https://github.com/andryyy/mailcow-dockerized &amp;&amp; cd mailcow-dockerized</code>). <strong>Pay attention</strong> to this step - the folder must have the same name of the previous one!</li>
<li>Copy back your previous <code>mailcow.conf</code> into the mailcow-dockerizd folder </li>
</ul>
<p>If you forgot to stop Docker before deleting the cloned directoy, you can use the following commands:</p>
<div class="codehilite"><pre><span></span>docker stop $(docker ps -a -q)
docker rm $(docker ps -a -q)
</pre></div>
<h3 id="step-2">Step 2<a class="headerlink" href="#step-2" title="Permanent link">&para;</a></h3>
<p>Pull new images (if any) and recreate changed containers:</p>
<div class="codehilite"><pre><span></span>docker-compose pull
docker-compose up -d --remove-orphans
</pre></div>
<h3 id="step-3">Step 3<a class="headerlink" href="#step-3" title="Permanent link">&para;</a></h3>
<p>Clean-up dangling (unused) images and volumes:</p>
<div class="codehilite"><pre><span></span>docker rmi -f $(docker images -f &quot;dangling=true&quot; -q)
docker volume rm $(docker volume ls -qf dangling=true)
</pre></div>
</article>
</div>
</div>
</main>
<footer class="md-footer">
<div class="md-footer-nav">
<nav class="md-footer-nav__inner md-grid">
<a href=".." title="This is mailcow" class="md-flex md-footer-nav__link md-footer-nav__link--prev" rel="prev">
<div class="md-flex__cell md-flex__cell--shrink">
<i class="md-icon md-icon--arrow-back md-footer-nav__button"></i>
</div>
<div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title">
<span class="md-flex__ellipsis">
<span class="md-footer-nav__direction">
Previous
</span>
This is mailcow
</span>
</div>
</a>
<a href="../first_steps/" title="First Steps" class="md-flex md-footer-nav__link md-footer-nav__link--next" rel="next">
<div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title">
<span class="md-flex__ellipsis">
<span class="md-footer-nav__direction">
Next
</span>
First Steps
</span>
</div>
<div class="md-flex__cell md-flex__cell--shrink">
<i class="md-icon md-icon--arrow-forward md-footer-nav__button"></i>
</div>
</a>
</nav>
</div>
<div class="md-footer-meta md-typeset">
<div class="md-footer-meta__inner md-grid">
<div class="md-footer-copyright">
powered by
<a href="http://www.mkdocs.org" title="MkDocs">MkDocs</a>
and
<a href="http://squidfunk.github.io/mkdocs-material/" title="Material for MkDocs">
Material for MkDocs</a>
</div>
<div class="md-footer-social">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<a href="https://github.com/mailcow/mailcow-dockerized" class="md-footer-social__link fa fa-github"></a>
</div>
</div>
</div>
</footer>
</div>
<script src="../assets/javascripts/application-30ac6a1727.js"></script>
<script>app.initialize({url:{base:".."}})</script>
</body>
</html>