algo/docs/cloud-do.md

109 lines
4.0 KiB
Markdown
Raw Normal View History

2018-04-23 22:58:40 +00:00
# DigitalOcean cloud setup
## API Token creation
First, login into your DigitalOcean account.
Select **API** from the titlebar. This will take you to the "Applications & API" page.
![The Applications & API page](/docs/images/do-api.png)
On the **Tokens/Keys** tab, select **Generate New Token**. A dialog will pop up. In that dialog, give your new token a name, and make sure **Write** is checked off. Click the **Generate Token** button when you are ready.
![The new token dialog, showing a form requesting a name and confirmation on the scope for the new token.](/docs/images/do-new-token.png)
2018-05-30 14:11:32 +00:00
You will be returned to the **Tokens/Keys** tab, and your new key will be shown under the **Personal Access Tokens** header.
2018-04-23 22:58:40 +00:00
![The new token in the listing.](/docs/images/do-view-token.png)
Copy or note down the hash that shows below the name you entered, as this will be necessary for the steps below. This value will disappear if you leave this page, and you'll need to regenerate it if you forget it.
2018-12-20 09:47:24 +00:00
## Using DigitalOcean with Algo (interactive)
2018-04-23 22:58:40 +00:00
2018-12-20 09:47:24 +00:00
These steps are for those who run Algo using Docker or using the `./algo` command.
2018-04-23 22:58:40 +00:00
2018-12-20 09:47:24 +00:00
Choose DigitalOcean as your provider:
2018-04-23 22:58:40 +00:00
```
2018-12-20 09:47:24 +00:00
What provider would you like to use?
2018-04-23 22:58:40 +00:00
1. DigitalOcean
2. Amazon Lightsail
3. Amazon EC2
2018-12-20 09:47:24 +00:00
4. Vultr
5. Microsoft Azure
6. Google Compute Engine
7. Scaleway
8. OpenStack (DreamCompute optimised)
9. Install to existing Ubuntu server (Advanced)
2018-04-23 22:58:40 +00:00
Enter the number of your desired provider
2018-12-20 09:47:24 +00:00
:
1
2018-04-23 22:58:40 +00:00
```
2018-12-20 09:47:24 +00:00
Enter a name for your server. Leave this as the default if you are not certain how this will affect your setup:
2018-04-23 22:58:40 +00:00
```
2018-12-20 09:47:24 +00:00
Name the vpn server:
[algo]:
2018-04-23 22:58:40 +00:00
```
2018-12-20 09:47:24 +00:00
After several prompts related to Algo features you will be asked for the API Token value. Paste the API Token value you copied when following the steps in [API Token creation](#api-token-creation) (you won't see any output as the key is not echoed by Algo):
2018-04-23 22:58:40 +00:00
```
2018-12-20 09:47:24 +00:00
Enter your API token. The token must have read and write permissions (https://cloud.digitalocean.com/settings/api/tokens):
(output is hidden):
2018-04-23 22:58:40 +00:00
```
2018-12-20 09:47:24 +00:00
Finally you will be asked the region in which you wish to setup your new Algo server. This list is dynamic and can change based on availability of resources. Enter the number next to name of the region:
2018-04-23 22:58:40 +00:00
```
2018-12-20 09:47:24 +00:00
What region should the server be located in?
1. ams3 Amsterdam 3
2. blr1 Bangalore 1
3. fra1 Frankfurt 1
4. lon1 London 1
5. nyc1 New York 1
6. nyc3 New York 3
7. sfo2 San Francisco 2
8. sgp1 Singapore 1
9. tor1 Toronto 1
2018-12-20 09:47:24 +00:00
Enter the number of your desired region
[6]
:
9
```
## Using DigitalOcean with Algo (scripted)
If you are using Ansible directly to run Algo you will need to pass the API Token as `do_token`. For example:
```shell
ansible-playbook main.yml -e "provider=digitalocean
server_name=algo
ondemand_cellular=true
ondemand_wifi=true
dns_adblocking=false
2018-12-20 09:47:24 +00:00
ssh_tunneling=false
store_pki=true
2018-12-20 09:47:24 +00:00
region=nyc3
do_token=token"
2018-04-23 22:58:40 +00:00
```
2018-12-20 09:47:24 +00:00
For more, see [Scripted Deployment](deploy-from-ansible.md).
## Using the DigitalOcean firewall with Algo
Many cloud providers include the option to configure an external firewall between the Internet and your cloud server. For some providers this is mandatory and Algo will configure it for you, but for DigitalOcean the external firewall is optional. See [AlgoVPN and Firewalls](/docs/firewalls.md) for more information.
2018-04-23 22:58:40 +00:00
2018-12-20 09:47:24 +00:00
To configure the DigitalOcean firewall, go to **Networking**, **Firewalls**, and choose **Create Firewall**.
2018-04-23 22:58:40 +00:00
2018-12-20 09:47:24 +00:00
Configure your **Inbound Rules** as follows:
2018-04-23 22:58:40 +00:00
2018-12-20 09:47:24 +00:00
![Inbound Rules](/docs/images/do-firewall.png)
2018-04-23 22:58:40 +00:00
2018-12-20 09:47:24 +00:00
Leave the **Outbound Rules** at their defaults.
2018-05-30 14:11:32 +00:00
2018-12-20 09:47:24 +00:00
Under **Apply to Droplets** enter the tag `Environment:Algo` to apply this firewall to all current and future Algo VPNs you create.