Files
caprover/docs/get-started.html
Kasra Bigdeli 1030fe0ec9 Deploy website
Deploy website version based on 8fe0506b3b1d032fc9021bfac183294fc655ac26
2019-01-13 15:46:30 -08:00

85 lines
20 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><title>Getting Started · CaptainDuckDuck</title><meta name="viewport" content="width=device-width"/><meta name="generator" content="Docusaurus"/><meta name="description" content="&lt;p&gt;&lt;br/&gt;&lt;/p&gt;
"/><meta name="docsearch:language" content="en"/><meta property="og:title" content="Getting Started · CaptainDuckDuck"/><meta property="og:type" content="website"/><meta property="og:url" content="https://www.captainduckduck.com/index.html"/><meta property="og:description" content="&lt;p&gt;&lt;br/&gt;&lt;/p&gt;
"/><meta property="og:image" content="https://www.captainduckduck.com/img/captainduckduck.png"/><meta name="twitter:card" content="summary"/><meta name="twitter:image" content="https://www.captainduckduck.com/img/captainduckduck.png"/><link rel="shortcut icon" href="/img/favicon.ico"/><link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/default.min.css"/><script type="text/javascript" src="https://buttons.github.io/buttons.js"></script><link rel="stylesheet" href="/css/main.css"/></head><body class="sideNavVisible separateOnPageNav"><div class="fixedHeaderContainer"><div class="headerWrapper wrapper"><header><a href="/"><img class="logo" src="/img/captainduckduck.png" alt="CaptainDuckDuck"/><h2 class="headerTitleWithLogo">CaptainDuckDuck</h2></a><div class="navigationWrapper navigationSlider"><nav class="slidingNav"><ul class="nav-site nav-site-internal"><li class="siteNavGroupActive siteNavItemActive"><a href="/docs/get-started.html" target="_self">Docs</a></li><li class=""><a href="https://github.com/githubsaturn/captainduckduck" target="_self">GitHub</a></li></ul></nav></div></header></div></div><div class="navPusher"><div class="docMainWrapper wrapper"><div class="container docsNavContainer" id="docsNav"><nav class="toc"><div class="toggleNav"><section class="navWrapper wrapper"><div class="navBreadcrumb wrapper"><div class="navToggle" id="navToggler"><i></i></div><h2><i></i><span>Basics</span></h2><div class="tocToggler" id="tocToggler"><i class="icon-toc"></i></div></div><div class="navGroups"><div class="navGroup"><h3 class="navGroupCategoryTitle">Basics</h3><ul><li class="navListItem navListItemActive"><a class="navItem" href="/docs/get-started.html">Getting Started</a></li><li class="navListItem"><a class="navItem" href="/docs/captain-definition-file.html">Captain Definition File</a></li><li class="navListItem"><a class="navItem" href="/docs/deployment-methods.html">Deployment Methods</a></li><li class="navListItem"><a class="navItem" href="/docs/app-configuration.html">App Configuration</a></li><li class="navListItem"><a class="navItem" href="/docs/complete-webapp-tutorial.html">Complete Webapp Tutorial</a></li></ul></div><div class="navGroup"><h3 class="navGroupCategoryTitle">Do More</h3><ul><li class="navListItem"><a class="navItem" href="/docs/enabling-https.html">Enabling HTTPS</a></li><li class="navListItem"><a class="navItem" href="/docs/one-click-apps.html">One-Click Apps</a></li><li class="navListItem"><a class="navItem" href="/docs/resource-monitoring.html">Resource Monitoring</a></li><li class="navListItem"><a class="navItem" href="/docs/nginx-customization.html">NGINX Config</a></li><li class="navListItem"><a class="navItem" href="/docs/app-scaling-and-cluster.html">App Scaling &amp; Cluster</a></li><li class="navListItem"><a class="navItem" href="/docs/pre-deploy-script.html">Pre-deploy Script</a></li><li class="navListItem"><a class="navItem" href="/docs/cli-commands.html">CLI Commands</a></li><li class="navListItem"><a class="navItem" href="/docs/run-locally.html">Run Locally</a></li></ul></div><div class="navGroup"><h3 class="navGroupCategoryTitle">Recipes and Tips</h3><ul><li class="navListItem"><a class="navItem" href="/docs/recipe-deploy-create-react-app.html">Static React App</a></li></ul></div><div class="navGroup"><h3 class="navGroupCategoryTitle">Help</h3><ul><li class="navListItem"><a class="navItem" href="/docs/server-purchase.html">Server Purchase</a></li><li class="navListItem"><a class="navItem" href="/docs/disk-cleanup.html">Disk Clean-Up</a></li><li class="navListItem"><a class="navItem" href="/docs/firewall.html">Firewall &amp; Port Forwarding</a></li><li class="navListItem"><a class="navItem" href="/docs/troubleshooting.html">Troubleshooting</a></li></ul></div></div></section></div><script>
document.addEventListener('DOMContentLoaded', function() {
createToggler('#navToggler', '#docsNav', 'docsSliderActive');
createToggler('#tocToggler', 'body', 'tocActive');
const headings = document.querySelector('.toc-headings');
headings && headings.addEventListener('click', function(event) {
if (event.target.tagName === 'A') {
document.body.classList.remove('tocActive');
}
}, false);
function createToggler(togglerSelector, targetSelector, className) {
var toggler = document.querySelector(togglerSelector);
var target = document.querySelector(targetSelector);
if (!toggler) {
return;
}
toggler.onclick = function(event) {
event.preventDefault();
target.classList.toggle(className);
};
}
});
</script></nav></div><div class="container mainContainer"><div class="wrapper"><div class="post"><header class="postHeader"><h1 class="postHeaderTitle">Getting Started</h1></header><article><div><span><p><br/></p>
<h2><a class="anchor" aria-hidden="true" id="prerequisites"></a><a href="#prerequisites" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Prerequisites</h2>
<h4><a class="anchor" aria-hidden="true" id="a-domain-name"></a><a href="#a-domain-name" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>A) Domain Name</h4>
<p>During installation, you'll be asked to point a wildcard DNS entry to your Captain IP Address. If you need help with domain name, see <a href="#setup-domain-and-dns">Domain and DNS</a>. This will cost you as low as $2 a year.</p>
<h4><a class="anchor" aria-hidden="true" id="b-server-with-a-public-ip"></a><a href="#b-server-with-a-public-ip" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>B) Server with a Public IP</h4>
<p>Captain has to be installed on a machine with a public IP address. If you need help with Public IP, see <a href="/docs/server-purchase.html">Server &amp; Public IP address</a>. This will cost you as low as $5 a month. If you use the DigitalOcean referral code, you'll get $10 credit - two months worth of free server: <a href="https://m.do.co/c/6410aa23d3f3">https://m.do.co/c/6410aa23d3f3</a></p>
<p><em><strong>CPU Architecture</strong>:</em> Although CaptainDuckDuck source code is compatible with any CPU architecture, the Docker build available on Docker Hub is built for x86 CPU. Therefore, If your CPU is ARM, you can download the source code and build it on your ARM architecture in order to run it.</p>
<p><em><strong>Recommended Stack</strong>:</em> CaptainDuckDuck is tested on Ubuntu 16.04 and Docker 17.06. If you're using CaptainDuckDuck on a different OS, you might want to look at <a href="https://docs.docker.com/engine/userguide/storagedriver/selectadriver/#supported-storage-drivers-per-linux-distribution">Docker Docs</a>.</p>
<p><em><strong>Minimum RAM</strong>:</em> Note that the build process sometimes consumes too much RAM, and 512MB RAM might not be enough (see <a href="https://github.com/githubsaturn/captainduckduck/issues/28">this issue</a>). Most providers offer a minimum of 1GB RAM on $5 instance including DigitalOcean, Vultr, Scaleway, Linode, SSD Nodes and etc.</p>
<p>You can install Captain on your laptop which is behind NAT (your router) for testing purposes, but it requires some special setup, like port forwarding.</p>
<h4><a class="anchor" aria-hidden="true" id="c-install-docker-on-server-at-least-version-1706x"></a><a href="#c-install-docker-on-server-at-least-version-1706x" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>C) Install Docker on Server (at least, version 17.06.x)</h4>
<p>If you get your server from DigitalOcean, you can select a server with &quot;pre-installed Docker&quot;. This will be the easiest option. Otherwise, you can install Docker CE by following <a href="https://docs.docker.com/engine/installation">this instruction</a></p>
<h4><a class="anchor" aria-hidden="true" id="d-disable-firewall"></a><a href="#d-disable-firewall" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>D) Disable Firewall</h4>
<p>Some server providers have strict firewall settings. To disable firewall on Ubuntu:</p>
<pre><code class="hljs css language-bash">ufw <span class="hljs-built_in">disable</span>
</code></pre>
<p><br/>
<br/></p>
<h1><a class="anchor" aria-hidden="true" id="captain-setup"></a><a href="#captain-setup" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Captain Setup</h1>
<h2><a class="anchor" aria-hidden="true" id="step-1-captain-installation"></a><a href="#step-1-captain-installation" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Step 1: Captain Installation</h2>
<p>Just run the following line, sit back and enjoy!</p>
<pre><code class="hljs css language-bash"> mkdir /captain &amp;&amp; docker run -p 80:80 -p 443:443 -p 3000:3000 -v /var/run/docker.sock:/var/run/docker.sock dockersaturn/captainduckduck
</code></pre>
<p>You will see a bunch of outputs on your screen. Once the Captain is initialized, you can visit <code>http://[IP_OF_YOUR_SERVER]:3000</code> in your browser and login to Captain using the default password <code>captain42</code>. You can change your password later. Do not make any changes in the dashboard. We'll use the command line tool to setup the server.</p>
<h2><a class="anchor" aria-hidden="true" id="step-2-connect-root-domain"></a><a href="#step-2-connect-root-domain" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Step 2: Connect Root Domain</h2>
<p>Let's say you own <code>mydomain.com</code>. You can set <code>*.something.mydomain.com</code> as an <code>A-record</code> in your DNS settings to point to the IP address of the server where you installed Captain. Note that it can take several hours for this change to take into effect. It will show up like this in your DNS configs:</p>
<ul>
<li><strong>TYPE</strong>: A record</li>
<li><strong>HOST</strong>: <code>*.something</code></li>
<li><strong>POINTS TO</strong>: (IP Address of your server)</li>
<li><strong>TTL</strong>: (doesn't really matter)</li>
</ul>
<p>To confirm, go to <a href="https://mxtoolbox.com/DNSLookup.aspx">https://mxtoolbox.com/DNSLookup.aspx</a> and enter <code>randomthing123.something.mydomain.com</code> and check if IP address resolves to the IP you set in your DNS. Note that <code>randomthing123</code> is needed because you set a wildcard entry in your DNS by setting <code>*.something</code> as your host, not <code>something</code>.</p>
<h2><a class="anchor" aria-hidden="true" id="step-3-install-captain-cli"></a><a href="#step-3-install-captain-cli" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Step 3: Install Captain CLI</h2>
<p>Assuming you have npm installed, simply run (add <code>sudo</code> if needed):</p>
<pre><code class="hljs css language-bash"> npm install -g captainduckduck
</code></pre>
<p>Then, run</p>
<pre><code class="hljs css language-bash"> captainduckduck serversetup
</code></pre>
<p>Follow the steps and login to your captain instance. When prompted to enter the root domain, enter <code>something.mydomain.com</code> assuming that you set <code>*.something.mydomain.com</code> to point to your IP address in step #2. Now you can access your captain from <code>captain.something.mydomain.com</code></p>
<h2><a class="anchor" aria-hidden="true" id="step-4-deploy-the-test-app"></a><a href="#step-4-deploy-the-test-app" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Step 4: Deploy the Test App</h2>
<p>Go to the Captain in your browser, from the left menu select Apps and create a new app. Name it <code>my-first-app</code>. Then, download any of the test apps <a href="https://github.com/githubsaturn/captainduckduck/tree/master/captain-sample-apps">here</a>, unzip the content. and while inside the directory of the test app, run:</p>
<pre><code class="hljs css language-bash">/home/Desktop/captain-examples/captain-node$ captainduckduck deploy
</code></pre>
<p>Follow the instructions, enter <code>my-first-app</code> when asked for app name. First time build takes about two minutes. After build is completed, visit <code>my-first-app.something.mydomain.com</code> where <code>something.mydomain.com</code> is your root domain.
CONGRATS! Your app is live!!</p>
<p>You can connect multiple custom domains (like <code>www.my-app.com</code>) to a single app and enable HTTPS and do much more in the app's settings page.</p>
<p>Note that when you run <code>captainduckduck deploy</code>, the current git commit will be sent over to your server. <strong>IMPORTANT:</strong> uncommited files and files in <code>gitignore</code> WILL NOT get pushed to the server.</p>
<p>You can visit Captain in the browser and set custom parameters for your app such as environment variables, and do much more! For more details regarding deployment, please see CLI docs. For details on <code>captain-definition</code> file, see <a href="/docs/captain-definition-file.html">Captain Definition File</a>.</p>
</span></div></article></div><div class="docs-prevnext"><a class="docs-next button" href="/docs/captain-definition-file.html"><span>Captain Definition File</span><span class="arrow-next"></span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#prerequisites">Prerequisites</a></li><li><a href="#step-1-captain-installation">Step 1: Captain Installation</a></li><li><a href="#step-2-connect-root-domain">Step 2: Connect Root Domain</a></li><li><a href="#step-3-install-captain-cli">Step 3: Install Captain CLI</a></li><li><a href="#step-4-deploy-the-test-app">Step 4: Deploy the Test App</a></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/captainduckduck.png" alt="CaptainDuckDuck" width="66" height="58"/></a><div><h5>Docs</h5><a href="/docs/en/get-started.html">Getting Started</a></div><div><h5>Community</h5><a href="https://twitter.com/search?vertical=default&amp;q=captainduckduck&amp;src=typd" target="_blank" rel="noreferrer noopener">Twitter</a><a href="https://join.slack.com/t/captainduckduck/shared_invite/enQtNDEwMjc3MjcxNjUzLWQ4YjljN2JiMGU5Nzk5NjcwMDEzNDNiMTNkOTVhNTA4YTYwOThkNDkyMTlkMDFhMzAzOTA5YjcwY2E4NWRkYzk" target="_blank" rel="noreferrer noopener">Slack Group</a></div><div><h5>More</h5><a href="https://github.com/githubsaturn/captainduckduck" target="_blank">GitHub</a><a class="github-button" href="https://github.com/githubsaturn/captainduckduck" data-icon="octicon-star" data-count-href="/githubsaturn/captainduckduck/stargazers" data-show-count="true" data-count-aria-label="# stargazers on GitHub" aria-label="Star this project on GitHub">Star</a></div></section><section class="copyright">Copyright © 2019 githubsaturn</section><script async="" src="https://www.googletagmanager.com/gtag/js?id=UA-121064489-1"></script><script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-121064489-1');
</script></footer></div></body></html>