How To Setup a Linux Workstation as a Development Environment

August 21, 2018

Tweet This: 
Share on LinkedIn:  

By Peter Phan, Kovarus, SDDC & Cloud Management


NetDevOps was a key topic at Cisco Live. Here is a definition from Hank Preston at Cisco, “NetDevOps brings the culture, technical methods, strategies, and best practices of DevOps to Networking.”

That sounds great but how does one get started with NetDevOps? Cisco has a great learning program at:

In this article, I will discuss how to build yourself an Ubuntu workstation to start your journey to NetDevOps nirvana. I use a windows machine as my daily, but picked Ubuntu since it would be easy to replicate to my peers.

We will be installing a basic DevOps toolset and verify that the tools are working correctly.

Step 1: Ubuntu Preparation

Use the following resource to Install Ubuntu as a VM on your machine:

  1. Install some basic Linux tools and utilities.
    • Ubuntu
      sudo apt update
      sudo apt install -y curl libssl-dev wget
    • CentOS
      sudo yum install -y curl \
         openssl-devel \
  1. Install the typical developer utilities and tools. (For example the gcc C compiler.)
    • Ubuntu
      sudo apt install -y build-essential \
        libffi-dev python-dev
    • CentOS
      sudo yum groupinstall -y "Development tools"

Step 2: Source Control Systems — git


  • Ubuntu
    sudo apt install -y git
  • CentOS
    (Git is installed as part of the Development tools.)


Let’s verify it is working as expected.

  • Open a terminal.
  • Run git –version. You should get output indicating the version of git installed.
    $ git --version
    git version 2.17.1
  • Attempt to clone down a repository from GitHub. We will also create a folder called “code.”
    mkdir ~/code; cd ~/code
    git clone
  • Expected Output.
    $ git clone
    Cloning into 'hello_network'...
    remote: Counting objects: 11, done.
    remote: Compressing objects: 100% (9/9), done.
    remote: Total 11 (delta 3), reused 6 (delta 1), pack-reused 0
    Unpacking objects: 100% (11/11), done.

Step 3: Terminals and Shells — Bash


  • The default terminal for Ubuntu is Bash. We are good here.


  • Change into the hello_network directory that you cloned down in the last step.
    cd hello_network
  • Included in the repository is a bash shell script called sh.
  • Run it to verify you have a functioning bash shell.
  • Expected Output.
    $ ./
    Hello Network!

Step 4: Programming Languages


  • There are two major version of Python: Python 2 and Python 3.
    • Python 3 is the recommended version, but many scripts are written in Python 2 and have not been updated.
    • We will install both versions.
  • Install Python 2.7.x and pip.
    • Use the following command.
      apt install -y python2.7 python-pip
  • Install Python 3.6.x.
    • Navigate to
    • Click Latest Python 3 Release – Python 3.6.x.
    • In the list, download “Windows x86-64 executable installer.”
    • Run the installation file. Accept the defaults with the following suggestions.
    • On the first screen, “Install Python 3.6.5,” select Add Python 3.6 to PATH at the bottom of the screen.
  • Verify install of Python 2 and Python 3.
    • If the following verifications do not work as expected, restart your computer to ensure the updated “PATH” variables are fully applied.
    • Open a git-bash.
    • Verify Python 3 was correctly installed.
      python3 -V
    • Expected Output.
      Python 3.6.5
    • Verify Python 2 was correctly installed.
      py -2 -V
    • Expected Output.
      Python 2.7.15rc1
    • Check that the version is set as the “Default Python Version.”
      The default version is the version of Python that is executed when you just type python.

      python -V
    • Expected Output.
      Python 2.7.15rc1

Final Python Setup

  • Now, we will set up Python Virtual Environments for each version of Python.
  • Python Virtual Environments are a method of creating isolated “environments” where specific versions of Python can be installed along with independent sets of libraries and dependencies.
  • Virtual Environment usage is a very common, and recommended, practice when working in Python.

Python 3 venv

  • Install venv.
    sudo apt install -y python3-venv
  • Create a directory to put our Python programming environments in.
    mkdir -p ~/code/environments; cd ~/code/environments
  • Create a Python 3 virtual environment using the venv.
    python3 -m venv py3-venv
  • To use this environment, you need to “activate” it.
    • Look for the name of the virtual environment to be enclosed in parenthesis after activation.
      source py3-venv/bin/activate
    • Expected Output.
      (py3-venv) pephan@ubuntu:~/code/environments$
  • Now verify that python is now linked to Python 3.
    $ python -V
    Python 3.6.5
  • Deactivate the virtual environment.

Python 2 venv

  • Install the virtualenv package for Python within Python 2.
    sudo python2.7 -m pip install virtualenv virtualenvwrapper
  • Expected Output.
    Collecting virtualenv
    Downloading virtualenv-15.2.0-py2.py3-none-any.whl (2.6MB)
    Installing collected packages: virtualenv
    Successfully installed virtualenv-15.2.0
  • Create a Python 2 virtual environment using the virtualenv module for Python 2.
    python2.7 -m virtualenv py2-venv
  • Activate the environment. Look for the name of the virtual environment to be enclosed in parenthesis after activation.
    source py2-venv/Scripts/activate
  • Expected Output.
    (py2-venv) pephan@ubuntu:~/code/environments$
  • Now verify that python is now linked to Python 2.
    $ python -V
    Python 2.7.15rc1
  • Deactivate the virtual environment.



  • Open a terminal.
  • Refresh local package index. Install node.js.
    sudo apt update
    sudo apt install nodejs
  • (Optional) Install npm (Node.js package manager).
    sudo apt install npm


  • Check the installed node version.
    $ node -v

Step 5: Text Editors and IDE


  • Open a terminal (CTRL+ALT+T).
  • Run the following command.
    sudo snap install atom --classic
  • NOTE: You can install updates by running:
    sudo snap refresh atom
  • Once installation is finished, you can start Atom by typing the following command in a terminal.
  • Or, you can start it from the start menu.

Step 6: Development Tools and Clients


  • You can install Postman on Ubuntu through the Ubuntu software center.
  • Open the Ubuntu Software Center. Search for “postman” and then click it.
  • Click Install.
  • Once the installation completes, Postman will open and allow you to sign up or sign in.
    • You do NOT need to sign in to use Postman.
    • You can click “Skip signing in and take me straight to the app…” to bypass login.
  • Test that you can make REST API calls with Postman with this fun “Dad Joke” API.
    • Close this pop up window.
    • Specify into the address bar.
    • Select the Headers tab. Add a Key for Accept with a Value of application/json.
    • Click Send and enjoy your joke.


  1. Open a terminal and change into the /opt directory.
    cd /opt
  2. Use wget to download the ngrok application.
    sudo wget
  3. Extract the downloaded file.
    sudo unzip
  4. Move the file into the /usr/local/bin directory to make it easily executable.
    sudo mv ngrok /usr/local/bin
  1. Start a sample ngrok tunnel.
    ngrok http 5000
  2. Expected Output.
    ngrok by @inconshreveable                                  (Ctrl+C to quit)
    Session Status                online
    Session Expires               7 hours, 59 minutes
    Version                       2.2.8
    Region                        United States (us)
    Web Interface       
    Forwarding           -> localhost:5000
    Forwarding           -> localhost:5000
    Connections                   ttl     opn     rt1     rt5     p50     p90
                                  0       0       0.00    0.00    0.00    0.00
  3. Press Ctrl-C to quit ngrok.

Google Chrome

  1. Navigate to Click Download Chrome.
  2. Select 64 bit. deb (For Debian/Ubuntu). Click Accept and Install.
  3. Run the downloaded installer file. Ubuntu Software will open.
  4. Click Install.
  5. You will need to provide your password to gain root privileges.
  6. Install is complete.

To access the Chrome Developer tools:

  1. Open Google Chrome, and click the “three dots” to the right of the address bar to access the menu.
  2. Go to More tools and click Developer tools.
  3. You will now see the developer tools open within the window.
  4. You can close Google Chrome.

(Optional) OpenConnect

If you do not already have Cisco AnyConnect installed, you can install OpenConnect for an open source VPN client to use to connect to DevNet Sandboxes.

  • Open Terminal.
  • Install OpenConnect from the Ubuntu Universe software repository.
    sudo apt-get install -y openconnect network-manager-openconnect \

To verify the OpenConnect installation you’ll need a VPN server to connect to. Go to the DevNet Sandbox Catalog and reserve one of the sandboxes. Once the reservation is ready, you’ll be provided the VPN credentials needed.

  • CLI Method
    • From the terminal, run the following command.
      openconnect -b <gateway-fqdn>
  • Example output
    $ sudo openconnect -b
    Attempting to connect to server
    SSL negotiation with
    Connected to HTTPS on
    XML POST enabled
    Please enter your username and password.
    GROUP: [Anyconnect-to-dCloud]:Anyconnect-to-dCloud
    XML POST enabled
    Please enter your username and password.
    Got CONNECT response: HTTP/1.1 200 OK
    CSTP connected. DPD 10, Keepalive 20
    Connect Banner:
    | " You are now connected to the Cisco dCloud RTP(US) Platform "
    Set up DTLS failed; using SSL instead
    Connected tun0 as, using SSL
    Continuing in background; pid 12812
  • GUI Method
    • Open System Settings => Network.
    • Click the plus button next to VPN to add a new connection.
    • Click Cisco AnyConnect Compatible VPN (openconnect).
    • On the Identity tab, complete as follows:

      • Name: Cisco DevNet
      • VPN Protocol: Cisco AnyConnect
      • Gateway: <gateway-fqdn>
      • Click Add
    • Confirm that you now have a new VPN connection available.
    • Click the off/on switch to enable it.
    • Click Connect to logon to the VPN.
    • Enter your username and password. Click Login.
    • Make a SecureSHell connection to a remote host to confirm that it is available via the VPN interface.
  • You should now have an active VPN connection to your sandbox, and be able to reach the resources contained within your pod.
  • You can end this process and disconnect with the following command.
    sudo pkill openconnect

Step 7: Application Container Engine


Installation — From Ubuntu Repository
  1. Install Docker and Docker Compose.
    sudo apt install -y docker-compose
  2. Start docker and make sure it starts on boot.
    sudo systemctl enable docker
    sudo systemctl start docker
    $ sudo systemctl status docker
  3. Verify that docker is running and enabled.
    $ sudo systemctl status docker
    ● docker.service - Docker Application Container Engine
    Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: e
    Active: active (running) since Tue 2018-07-03 18:23:15 PDT; 18h ago
    Main PID: 8388 (dockerd)
  4. Setup permissions so you don’t need sudo for every docker command.
    1. Create a docker group. The package for Ubuntu does this for you.
      sudo groupadd docker
    2. Add your user to the docker group.
      sudo usermod -aG docker $USER
    3. Log out and log back in so that your group membership is re-evaluated.
  1. Open a terminal.
  2. See what version of docker is installed.
    $ docker --version
    Docker version 17.12.1-ce, build 7390fc6
  3. Enter the following command to start a test container based on the “busybox” image.
    docker run busybox
  4. Verify it worked with the following command.The container will start and then stop showing no output.
    $ docker ps -a
    CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS                     PORTS               NAMES
    dfcf32f22506        busybox             "sh"                3 minutes ago


You’ve completed the setup of the Linux developer workstation. Let us know if this article is of interest to you.