Go back

Setup and installation of 'LangFlow & LangChain' on AWS

This section describes how to launch and connect to AI App Development using LangChain & LangFlow on Amazon Web Services (AWS).

  1. Open AI App Development using LangChain & LangFlow VM listing on AWS marketplace

/img/aws/langchain-langflow-vm/marketplace.png

  1. Click on Continue to subscribe.
  • Login with your credentials and follow the instruction.
  • Subscribe to the product and click on Continue to configuration button.
  • Select a Region where you want to launch the VM(such as US East (N.Virginia))

/img/aws/langchain-langflow-vm/region.png

  • Click on Continue to Launch Button.
  • Choose Action: You can launch it through EC2 or from Website.(Let’s choose Launch from website)

/img/aws/langchain-langflow-vm/launch.png

  • Optionally change the EC2 instance type. (This defaults to t2.medium instance type, 2 vCPUs and 8 GB RAM.)
  • Optionally change the network name and subnetwork names.

/img/aws/langchain-langflow-vm/vpc.png

  • Select the Security Group. Be sure that whichever Security Group you specify have ports 22 (for ssh) and 3389 (for RDP) exposed. Or you can create the new SG by clicking on “Create New Based On Seller Settings” button. Provide the name and description and save the SG for this instance.

/img/aws/desktop-linux-ubuntu2404/create-new-sg.png

/img/aws/langchain-langflow-vm/SG.png

  • Be sure to download the key-pair which is available by default, or you can create the new key-pair and download it. /img/aws/langchain-langflow-vm/key-pair.png

  • Click on Launch..

  • AI App Development using LangChain & LangFlow will begin deploying.

  1. A summary page displays. To see this instance on EC2 Console click on EC2 Console link.

/img/aws/langchain-langflow-vm/deployed.png

  1. On the EC2 Console page, instance is up and running. To connect to this instance through putty, copy the IPv4 Public IP Address

/img/aws/langchain-langflow-vm/public-ip.png

  1. Open putty, paste the IP address and browse your private key you downloaded while deploying the VM, by going to **SSH->Auth->Credentials **, click on Open. Enter ubuntu as userid

/img/aws/desktop-linux/putty-01.png

/img/aws/nvidia-aiml/putty-02.png

/img/aws/langchain-langflow-vm/ssh-login.png

  1. Once connected, change the password for ubuntu user using below command
sudo passwd ubuntu

/img/aws/desktop-linux-ubuntu2404/ssh.png

  1. Now the password for ubuntu user is set, you can connect to the VM’s desktop environment from any local Windows Machine using RDP protocol or Linux Machine using Remmina.

From your local windows machine, goto “start” menu, in the search box type and select “Remote desktop connection”. In the “Remote Desktop connection” wizard, copy the public IP address and click connect

/img/aws/desktop-linux/rdp.png

  1. This will connect you to the VM’s desktop environment. Provide the username (e.g “ubuntu”) and the password set in the above “Reset password” step to authenticate. Click OK

/img/aws/desktop-linux/rdp-login.png

  1. Now you are connected to the out of box AI App Development using LangChain & LangFlow environment via Windows Machine.

/img/aws/langchain-langflow-vm/rdp-desktop.png

  1. To connect using RDP via Linux machine, first note the external IP of the VM from VM details page,then from your local Linux machine, goto menu, in the search box type and select “Remmina”.

Note: If you don’t have Remmina installed on your Linux machine, firstInstall Remmina as per your linux distribution.

/img/gcp/common/remmina-search.png

  1. In the “Remmina Remote Desktop Client” wizard, select the RDP option from dropdown and paste the external ip and click enter.

/img/gcp/common/remmina-external-ip.png

  1. This will connect you to the VM’s desktop environment. Provide “ubuntu” as the userid and the password set in above reset password step to authenticate. Click OK

/img/gcp/common/remmina-rdp-login.png

  1. Now you are connected to out of box AI App Development using LangChain & LangFlow environment via Linux machine.

/img/aws/langchain-langflow-vm/rdp-desktop.png

  1. To access the Langflow User interface, connect to the terminal and run below command to create LangFlow superuser and provide the username and password for super user. This will be used for logging in to langflow.
sudo langflow superuser

/img/aws/langchain-langflow-vm/create-superuser.png

  1. Once Superuser is created, open https://vm-public-ip in your local browser, accept the SSL warning by clicking advanced and login using the superuser credentials used in above step.

/img/aws/langchain-langflow-vm/ssl-warning.png

/img/aws/langchain-langflow-vm/superuser-login.png

  1. Now you are logged in to LangFlow user interface using superuser.

/img/aws/langchain-langflow-vm/langflow-home-page.png

  1. On the home page, click on key icon at the top right to generate the new API keys.

/img/aws/langchain-langflow-vm/click-key.png

  1. On this page, click on “Create new secret key”.

/img/aws/langchain-langflow-vm/create-secret-key.png

  1. A pop up will appear, provide a name to your secret key and hit “Create secret key”

/img/aws/langchain-langflow-vm/provide-secret-key-name.png

  1. It will generate a secret key for you. Make sure to copy and save it somewhere.

/img/aws/langchain-langflow-vm/provide-secret-key-name.png

/img/aws/langchain-langflow-vm/key-created.png

  1. You can also create new user and make them active/superuser from this UI. To do so click on the circle icon at the top right of this page and select Admin page.

/img/aws/langchain-langflow-vm/select-admin-page.png

  1. On Admin Page, click on New User. A pop up will appear, enter the details of the new user. You can also make it active or superuser from this page.

/img/aws/langchain-langflow-vm/admin-page.png

/img/aws/langchain-langflow-vm/add-new-user.png

  1. New user can also signup on their own by clicking on “Signup link” on login page. Provide the details on this page and it will create new user but admin/superuser has to activate the newly created user.

/img/aws/langchain-langflow-vm/select-signup.png

/img/aws/langchain-langflow-vm/signup-page.png

  1. To activate the new user, Login with superuser, go to Admin page and check the activate checkbox or superuser checkbox if you want to make this user as superuser. Click confirm on the Confirmation popup. Now your new user is active. You can login and use LangFlow UI with this user.

/img/aws/langchain-langflow-vm/activate-new-user.png

/img/aws/langchain-langflow-vm/confirm.png

/img/aws/langchain-langflow-vm/new-user-login.png

Go back