I want to be able to work with git via my AWS Lightsails SSH terminal running on bitnami, how do I connect the terminal to bitbucket via SSH so that I can clone the repo each time I need to make a deployment. Also If there are better ways of deploying a nuxt app to aws lightsails, please share.
Asked
Active
Viewed 1,228 times
-1
-
Can you explain why you are doing a git clone every time? Why not create a pipeline which triggers when you do a git push to your Bitbucket repo? – Marakai May 05 '20 at 01:34
2 Answers
1
First create a new ssh-key and add it under .ssh/authorized_keys
in your AWS Lightsail instance.
Add your created deployment key in Bitbucket. Then write a bitbucket deployment pipeline to deploy. You can find sample configs from here.

Vishnu Nair
- 1,399
- 1
- 14
- 21
0
Before you choose to go this route consider that cloning a repo isn't going to make lightsail work automatically. You still have to prepare the correct entry point (domain) and then for example if you're running an express server you'd have to prepare the lightsail instance for that.
Having said that create an ssh key:
1. ssh-keygen -t ed25519 -C "your email"
2. Save to directory (you can change if you'd like):
Enter file in which to save the key (/home/bitnami/.ssh/id_ed25519)
3. Enter password or hit return for no password
4. Copy your ssh key: cat /home/bitnami/.ssh/id_ed25519.pub
5. In bitnami click your repository then you will see left hand menu. There click on Repository Settings
6. Click Access keys (left hand menu)
7. Click Add Key
8. Enter the label and paste the contents of step 4 (should be in terminal of step 4). Click Add SSH Key.
After this you should be able to clone and execute git commands. (Please make sure git is added to the server)

FabricioG
- 3,107
- 6
- 35
- 74