Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

How to Install and Configure doctl on MacOS

-Step 1: Install doctl
-Install doctl following the directions for your package manager or operating system:
-To install the latest version of doctl using Homebrew on macOS, run:


brew install doctl


-Step 2: Create an API token
-Create a DigitalOcean API token for your account with read and write access from the Applications & API page in the control panel. The token string is only displayed once, so save it in a safe place.
-Step 3: Use the API token to grant account access to doctl
-Note
-If you installed doctl using the Ubuntu Snap package, you may need to first create the user configuration directory if it does not exist yet by running mkdir ~/.config.
-Use the API token to grant doctl access to your DigitalOcean account. Pass in the token string when prompted by doctl auth init, and give this authentication context a name.


doctl auth init --context <NAME>


-Authentication contexts let you switch between multiple authenticated accounts. You can repeat steps 2 and 3 to add other DigitalOcean accounts, then list and switch between authentication contexts:


doctl auth list
doctl auth switch --context <NAME>


-Step 4: Validate that doctl is working
-Now that doctl is authorized to use your account, try some test commands.
-To confirm that you have successfully authorized doctl, review your account details by running:


doctl account get


-If successful, the output will look like:


Email                      Droplet Limit    Email Verified    UUID                                        Status
sammy@example.org          10               true              3a56c5e109736b50e823eaebca85708ca0e5087c    active


-To confirm that you have successfully granted write access to doctl, create an Ubuntu 18.04 Droplet in the SFO2 region by running:


doctl compute droplet create --region tor1 --image ubuntu-18-04-x64 --size s-1vcpu-1gb <DROPLET-NAME>


-The output of that command will include an ID column with the new Droplet’s ID. For example:


ID           Name            Public IPv4    Private IPv4    Public IPv6    Memory    VCPUs    Disk    Region    Image                       Status    Tags    Features    Volumes
187949338    droplet-name                                                  1024      1        25      sfo2      Ubuntu 18.04.3 (LTS) x64    new


-Use that value to delete the Droplet by running:


doctl compute droplet delete <DROPLET-ID>


-When prompted, type y to confirm that you would like to delete the Droplet.
-Step 5: Install Serverless Functions support (Optional)
-To use doctl with our serverless Functions product, you must first install a software extension, then use it to connect to the development namespace.
-To install the support for serverless Functions, run the serverless install subcommand:


doctl serverless install


-This will download and install the extension, providing status updates along the way:


Downloading...Unpacking...Installing...Cleaning up...
Done


-Next, connect to the development namespace with serverless connect:


doctl serverless connect


-This will output the name and API host of your namespace:


Connected to function namespace 'fn-feb132ee-706a-4f13-9c81-f24a3330260b' on API host 'https://faas-nyc1-78edc.doserverless.co'


-You are now ready to create and deploy functions. See the [Functions Quickstart]/products/functions/quickstart/) to get started.
Comment

PREVIOUS NEXT
Code Example
Shell :: rollup emotion 
Shell :: pam_unix(cron:session): session opened for user root(uid=0) by (uid=0) 
Shell :: git undo changes single file 
Shell :: npm nix 
Shell :: join rows in one string linux 
Shell :: set swap space aws 
Shell :: calculate folder storage in command line 
Shell :: Wait for Android emulator to be running before next shell command 
Shell :: read (subshell_pty...): No such file or directory (2) 
Shell :: go to commit remote 
Shell :: Hands-on GitHub Actions: Implement CI/CD with GitHub Action Workflows for Your Applications.pdf 
Shell :: print the current folder path. 
Shell :: delete file bash script with time and date 
Shell :: bash count occurrences of character in string 
Shell :: scipy optimize how to install 
Shell :: Change cursor style in cmd ,Powershell ,terminal ,git bash 
Shell :: 7zip split archive command line fat32 
Shell :: grep in a laravel project 
Shell :: how do I delete existing mobile broadband connections in Linux Ubuntu 
Shell :: slapd debugging 
Shell :: run docker yml arch linux 
Shell :: heroku config:set NPM_CONFIG_PRODUCTION=false YARN_PRODUCTION=false ERROR 
Shell :: what is -e flag for in bash sed? 
Shell :: Display curl output in readable JSON format in Unix shell script 
Shell :: explicitly pull images from docker hub and list them on your terminal 
Shell :: KDE Connect Command PC turn off 
Shell :: install ponylang 
Shell :: apt disable ipv6 
Shell :: barryvdh dompdf file_getcontents passing null 
Shell :: localhost/xampp/index.php 
ADD CONTENT
Topic
Content
Source link
Name
9+3 =