-
Notifications
You must be signed in to change notification settings - Fork 0
Getting Started
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 Domain & DNS. This will cost you as low as $2 a year.
Captain has to be installed on a machine with a public IP address. If you need help with Public IP, see Server & Public IP. 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: https://m.do.co/c/6410aa23d3f3
Note: that 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.
If you get your server from DigitalOcean, you can select a server with "pre-installed Docker". This will be the easiest option. Otherwise, you can install Docker CE by following this instruction: https://docs.docker.com/engine/installation
Just run the following line, sit back and enjoy!
mkdir /captain && docker run -v /var/run/docker.sock:/var/run/docker.sock dockersaturn/captainduckduck
You will see a bunch of outputs on your screen. Once the Captain is initialized, you can visit http://[IP_OF_YOUR_SERVER]:3000 in your browser.
Login to Captain using the default password captain42. You can change your password later.
Let's say you own mydomain.com. You can set *.something.mydomain.com as an A-record in your DNS settings to point to the IP address of the server where you installed Captain. If you need help with this, see Domain & DNS.
To confirm, go to https://mxtoolbox.com/DNSLookup.aspx and enter randomthing123.something.mydomain.com and check if IP address resolves to the IP you set in your DNS.
Note: that randomthing123 is needed because you set a wildcard entry in your DNS by setting *.something as your host, not something.
Assuming you have npm installed, simply run (add sudo if needed):
npm install -g captainduckduck
Then, run
captainduckduck serversetup
Follow the steps and login to your captain instance. When prompted to enter the root domain, enter something.mydomain.com assuming that you set *.something.mydomain.com to point to your IP address in step #2. Now you can access your captain from captain.something.mydomain.com
Go to the Captain in your browser, from the left menu select Apps and create a new app. Name it my-first-app. Then, download any of the test apps here, unzip the content. and while inside the directory of the test app, run:
/home/Desktop/captain-examples/captain-node$ captainduckduck deploy
Follow the instructions, enter my-first-app when asked for app name. First time build takes about two minutes. After build is completed, visit my-first-app.something.mydomain.com where something.mydomain.com is your root domain. CONGRATS! Your app is live!!
Note: that when you run captainduckduck deploy, the current git commit will be sent over to your server. IMPORATANT: uncommited files and files in gitignore WILL NOT get pushed to the server.
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 captain-definition file, see Captain Definition File.
At this point you are logged into your server and you can run:
docker run -v /var/run/docker.sock:/var/run/docker.sock dockersaturn/captainduckduck