Skip to main content
SearchLogin or Signup

Video Tutorial: How to Install Docassemble on Amazon Web Services

Sam Harden provides step-by-step instructions to install Docassemble on Amazon Web Services. Video 1 of 3.

Published onDec 06, 2019
Video Tutorial: How to Install Docassemble on Amazon Web Services
·

Video

How to install Docassemble on Amazon Web Services

Overview

Docassemble is a free, open-source expert system for guided interviews and document assembly, based on Python, YAML, and Markdown. Docassemble has strong implications for the potential of computational law because it is a free and straightforward tool for computing legal processes and legal functions.

This lesson provides a step-by-step walkthrough of everything required to set up Docassemble using Amazon Web Services. Follow these instructions, and you will have your very own instance of Docassemble from which you can compute the law.


AWS

  1. Go to www.aws.amazon.com to create a new EC2 instance (Link)

  2. Sign into console (Link)

Note: If you haven’t created an account, you will need to create an account

Note: New accounts can take up to 24 hours to activate

Pro tip: In a new session, to sign in to an existing account on www.aws.amazon.com you actually click to option to create a new account then look for sign-in with existing account under create account

  1. The service that will be used to run Docassemble is EC2. Select services tab at the top, then select EC2 under Compute, and this will bring up EC2 dashboard (Link)

  2. In the EC2 dashboard, you can see what resources you are using and other information about your account (Link)

  3. To begin creating the instance for Docassemble, select Launch Instance (Link)

  4. Amazon offers a wide variety of cloud computing configurations that you can choose from. These different configurations are referred to as instances. (Link)

  5. Select the instance for “Amazon Linux 2 AMI (HVM, SSD Volume Type).” (Link)

  6. Now, it is time to choose an Instance Type. Each instance has types associated with it that determine things like how much memory is available, how many vCPUs are available, pricing etc. (Link)

  7. For different the myriad considerations of the project, such as workload, budget, etc., different instance types will be favorable over others. Here, because we will show you the most lightweight option for configuring Docassemble. Because Docassemble requires more than 1 gb of storage we will choose the “General Purpose” “t2.medium” “4 gb.” (Link)

  8. Once you have selected the General Purpose t2.medium 4 instance type, click the white button for “Next: Configure Instance Details.” (Link)

  9. The features on this page can be customized based on the particular needs of a user or a system. We do not need to change any of these features now in order to get Docassemble running. (Link)

  10. The next step will be to select “Next: Add Storage.” (Link)

  11. We are going to increase the “Size (GB)” from the default of 8 to 29. (Link)

  12. Next: add tags. (Link)

  13. Next: Configure Security Group. We create a new security group to determine who and what can access the EC2 instance. In order to change things in your EC2 instance, you must configure the instance so that your IP address can access this. In order to prevent unwanted people from accessing the EC2 instance, only the IP addresses that are listed will be able to access the EC2 instance. SSH, Secure Shell, is a type of connection to the EC2 instance that allows you to access it from the command line. (Link)

Note: the default IP address of 0.0.0.0/0 allows anyone anywhere to access the EC2 instance as long as they have the appropriate password.

  1. We are going to change this to My IP address, which automatically reads your individual IP address. (Link)

Pro Tip: it is a best practice to add IP addresses for the different locations you work from (e.g., house, office, coworking spaces, etc.)

  1. Because we want people to be able to access the external facing Docassemble content that we are producing, we need to add an additional rules. Select “Add Rule” on the left hand side of the page and we are going to add some rules. (Link)

  2. Under type, select HTTP; Under port, select 80; Leave Source as the default IP of 0.0.0/0. This allows anyone to access the front end of your instance. (Link)

  3. Next, we are going to add another rule. Select “Add Rule.” In the new rule, change the type to HTPPS; change the Port to 443; and leave the default IP as 0.0.0/0 (Link)

  4. Select Review and Launch on the right hand side of the page. (Link)

  5. Select “Launch” at the bottom of the page. This brings up a screen that says to “Select an existing key pair or create a new key pair.” A key pair is a file that allows you to access the EC2 instance through the Secure Shell (SSH), aka the administrative side. (Link)

  6. Create a new key-pair by toggling the first drop down, name the key pair: “my-new-key-pair” and then click download key pair. (Link)

  7. Save the key pair in a place that you will not lose it. (Link)

Note: be sure to save a backup of your key pair somewhere.

  1. Select Launch Instance. It takes a few minutes to launch the instance. (Link)

  2. Navigate back to the EC2 dashboard by selecting Services at the top of the page and then clicking EC2. This brings up your various instances. (Link)

  3. Because your launching instance doesn’t have a name, go ahead and name the launching instance. Click the blank under name and type in “Bob.” (Link)

  4. The file will now take a moment to initialize. We know the file is initialized when the “Instance State” reads “Running.” (Link)

Note: The initialization could take a few minutes - be patient

Note: Under the column named “Status Checks” the status will change from “initializing” to “running” when this operation is done and then you can proceed to the next step.

  1. Once the file has initialized, now we need to connect to Bob, our instance. (Link)

Terminal

  1. This part of the tutorial involves a few basic commands from a terminal window. To learn more what you can do from a Command Line Interface (CLI) and how these commands operate, check out:https://openclassrooms.com/en/courses/4614926-learn-the-command-line-in-terminal/4634361-create-your-first-directory

  2. To create a directory, type in mkdir + [name of your directory] (for example: mkdir docassemble-folder) --> then, open finder, search for [name of your directory] and copy the key pair file into the directory

  3. Open Terminal if you are using a Mac. If you are using Windows, Linux, etc., you will use a different command line based on the operating system you are working from but the commands are approximately the same. (Link)

  4. On a Mac, to open Terminal, just click open the Launchpad, then search for Terminal and click on the Terminal icon to open that application. In Terminal, a line will show up with the label you have given to your Laptop and the name given to your user. In this case, the name of the laptop is “Sams-MBP” and the name of the laptop is “samharden” with a dollar sign at the end. (Link)

  5. From Terminal, type cd bob to navigate to the correct directory. (Link)

  6. Once you have navigated to the correct directory, type ls to view the files in the directory. This will bring up “my-new-key-pair” the file that allows us to access the EC2 instance from the command line. (Link)

Note: you can only connect to the EC2 instance if while using Terminal you are in the same directory where your key pair is living; if you try it in a different folder, it will not work because AWS is looking for that key pair.

  1. To get into the EC2 instance, type: sudo ssh -i “my-new-key-pair.pem” ec2-18-216-155-205.us-east-2.compute.amazonaws.com (Link)

Notesudo ssh is the type of connection, -i “my-new-key-pair.pem” is the name of your key pair file, and ec2-user@ec2-52-72-87-180.compute-1.amazonaws.com

Note: The prefix of ec2-user is always going to be the same. Everything after the @ sign is going to be different for each user and is based on the Public DNS (IPv4), which is located in the EC2 dashboard. You will copy and paste the Public DNS (IPv4) from your EC2 dashboard into your command line.

Note You must use the sudo command to edit the file as a Super User, otherwise you will not have the adequate permissions to edit the file, click enter to execute the command and it will bring up the command line for the instance of AWS where Docassemble will be running

  1. In order to get Docassemble running, we must install all the dependencies into our instance of AWS. To do this, in the Command Line, type: sudo yum -y update and hit enter. (Link)

Note: this will look for updates to the operating system in AWS

  1. Once this is complete, we will install Docker. Install Docker from the Command Line by typing, sudo yum -y install docker. (Link)

  2. Once you have installed Docker, type sudo service docker start to make sure it is running. (Link)

  3. Now, Docker is running in our EC2 instance and we are ready to start running Docassemble. (Link)

  4. In the command line, type sudo docker run -d -p 80:80 -p 443:443 jhpyle/docassemble (Link)

Notesudo indicates we are running from super user; -d means we want this to run in the background; -p indicates that we want to open the ports that we configure in the EC2 instance and the commands indicate which ports to open;jhpyle/docassembleis the docker container that we are choosing to run. A docker container is a package of software code that allows an individual to run a software on their own machine

  1. Hit enter, this downloads Jonathan Pyle’s instance and gets it ready to run for us. There are a lot of files in this instance, so it will take a minute to download. (Link)

  2. Now, Docassemble is running. From the command line, type sudo docker ps it shows us the running container of Docassemble. (Link)

AWS

  1. From EC2 Dashboard, select the instance for Bob. (Link)

  2. The public DNS address is the web address for our Docker container. Copy that and type it into the browser. (Link)

  3. This brings up a Demonstration Interview and this means… You are now running your own instance of Docassemble in your own cloud computing instance. You can edit your guided interview so that others can access it. (Link)

Docassemble

  1. Because the Demonstration Interview isn’t exactly useful in itself, and because we want to do things with Docassemble, we need to sign in and create a new account that allows us to edit the interview. (Link)

  2. Select “Sign in or sign up to save answers.” (Link)

  3. In every version of Docassemble, you must sign in with the default user. The email for the default user is
    admin@admin.com" and the password is “password” next, hit enter and change your password. (Link)

  4. Once you have changed your password, you are inside the Docassemble web application as the administrator. (Link)

  5. Now, from the drop down menu at the top of the screen, we can change our “User Profile” to include our name and select Save. (Link)

  6. From the drop down menu at the top of the page, select “user list”, change email address, and click Save. (Link)

  7. Next, from the Dropdown, navigate to the Playground to edit interview that are deployed on Docassemble. (Link)


Want to learn more about what Sam Harden is up to?

Follow his latest work on his youtube channel, LegalTech School or check out his website samharden.github.io

Comments
0
comment

No comments here