Skip to content

Instantly share code, notes, and snippets.

@wongcyrus
Last active September 11, 2021 12:25
Show Gist options
  • Star 8 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save wongcyrus/116b48347db0740d3d89e66bacf70002 to your computer and use it in GitHub Desktop.
Save wongcyrus/116b48347db0740d3d89e66bacf70002 to your computer and use it in GitHub Desktop.
Install and run Visual Studio Code (Code-Server) in AWS Cloud9
ip=$(curl http://169.254.169.254/latest/meta-data/public-ipv4)
echo "Code Server"
echo "http://$ip:8443"
security_group=$(ec2-metadata -s | cut -d " " -f 2);
aws ec2 authorize-security-group-ingress --group-name $security_group --protocol tcp --port 8443 --cidr 0.0.0.0/0
version="1.32.0-310"
wget https://github.com/codercom/code-server/releases/download/$version/code-server-$version-linux-x64.tar.gz
tar -xvzf code-server-$version-linux-x64.tar.gz
cd code-server-$version-linux-x64
chmod +x code-server
./code-server -p 8443
@uday12kumar
Copy link

Hi

what is this ip

ip=$(curl http://169.254.169.254/latest/meta-data/public-ipv4)

do we have to give the cloud9 public ip ?

@hasip-timurtas
Copy link

@uday12kumar yes. that line for getting public ip address.

@behrens-cloud
Copy link

Hello, I get this: Unknown option -p

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment