<p>A website is only a website if other people can look at it. While you are
developing locally that's not really all that helpful. So how do you get
your changes up to your favorite web host? This is where <ahref="../cli/deploy/"class="ref">lektor deploy</a> comes in.</p>
<h2id="deploying-in-two-steps">Deploying in Two Steps:</h2><p>Deploying a website in Lektor is a two step process:</p>
<ol>
<li>build</li>
<li>deploy</li>
</ol>
<p>Keep this in mind. A deploy will not implicitly build! This means that if
you deploy without building first you might send up a completely wrong
version! Also more importantly: <em>never deploy unless the build finished
successfully</em>.</p>
<h2id="the-build-pipeline">The Build Pipeline</h2><p>So let's cover the building first. When you use the Lektor server locally,
Lektor constantly builds out your website into static HTML files behind the
scenes into the default build folder. This folder is in an operating system
specific location. If you want to know where that folder is, you can use this
command:</p>
<pre><code>$ lektor project-info --output-path
</code></pre>
<p>Additionally you can manually provide a different path if you kick off a
manual build:</p>
<pre><code>$ lektor build --output-path my-folder
</code></pre>
<p>Generally we strongly recommend to use the default build folder when deploying
from your own machine because it will be faster since the build can reuse
what the development server already did. If you want to deploy from a build
server it might make more sense to provide absolute paths.</p>
<h2id="lektor-assisted-deployments">Lektor Assisted Deployments</h2><p>Currently Lektor can deploy via <code>rsync</code> and <code>ftp</code> automatically. To enable
this functionality you need to configure this in the config file. For each
potential deployment target add a <code>[servers.NAME]</code> section. The supported
keys are <code>name</code> for an optional human readable name of the server, <code>enabled</code> to
enable or disable it (defaults to <code>true</code>) and <code>target</code> which is the URL to
publish to. Additionally one of the servers can have <code>default</code> set to <code>yes</code>
<divclass="admonition admonition-warning"><p><strong>Note on credentials</strong>: For FTP and other systems it is possible to embed
the credentials directly in the URL. If you do this, please ensure that
you keep your project file secure as loss of the project file can mean that
people get access to your server. Alternatively you can also provide username
and password through the command line or environment variables.</p></div><p>The following targets are supported for the <code>target</code> field natively:</p>
<ul>
<li><ahref="rsync/">rsync</a></li>
<li><ahref="ftp/">FTP</a></li>
<li><ahref="ghpages/">GitHub Pages</a></li>
</ul>
<p><strong>In addition</strong>, there are <ahref="../../plugins/categories/deploy/"class="ref">third-party plugins</a> available for additional deploy targets.</p>
<h2id="manual-deployments">Manual Deployments</h2><p>If you want to manually deploy something through the favorite tool of yours
you can do that easily as well. For instance if you want to deploy to S3
with <ahref="http://s3tools.org/s3cmd-sync">s3cmd</a> you could do this:</p>
Please enable JavaScript to view the <ahref="https://disqus.com/?ref_noscript"
rel="nofollow">comments powered by Disqus.</a>
</noscript>
</div>
</div>
</div>
</div>
</div>
<divclass="bottomsummary">
<divclass="container">
</div>
</div>
<footer>
<divclass="container">
<divclass="row">
<divclass="col-sm-4 icon-bar">
<ahref="https://github.com/lektor/lektor/"title="Lektor on GitHub"
><iclass="fa fa-github"></i></a>
<ahref="https://github.com/lektor/lektor/issues/"title="Report Issues for Lektor"
><iclass="fa fa-bug"></i></a>
<ahref="https://twitter.com/getlektor"title="Find Lektor on Twitter"
><iclass="fa fa-twitter"></i></a>
<ahref="https://gitter.im/lektor/lektor"title="Chat on Gitter"
><iclass="fa fa-comment"></i></a>
<ahref="https://github.com/lektor/lektor-website/tree/master/content/docs/deployment/contents.lr"title="View source for this page"><iclass="fa fa-code"></i></a>
</div>
<divclass="col-sm-8">
<ahref="../../license/">License & Copyright</a> •
<ahref="../../contact/">Contact</a> •
Made with <iclass="fa fa-fw fa-heart"title="Heart"><spanhidden>Heart</span></i> in Carinthia