amazon-web-servicesamazon-ec2code-server

Code server on AWS EC2 return error and doesn't start


I follow the guide to install code-server on EC2, but it doesn't works.

When I access to my instance from browser, I have this error:

Error connecting to your code-server instance
Ensure code-server is running and was properly started with the --link command line flag.

I've tried to install code-server on EC2 manually, but it doesn't start. At the end I've found code-server on aws marketplace (aws.amazon.com/marketplace/pp/prodview-bw5rwv7u435ey) and follow the instruction, but at the command:

 systemctl status code-server

I've got:

code-server.service
     Loaded: bad-setting (Reason: Unit code-server.service has a bad unit file setting.)
     Active: inactive (dead)

How can I run code-server on AWS EC2?

Thank you


Solution

  • Install code-server only by install script.

    curl -fsSL https://code-server.dev/install.sh | sh
    

    Install Caddy. It works

    Don't follow the guide on gitHub, don't run launch-code-server.sh

    When you will access by browser it will ask you the password. You find the password on ~/.config/code-server/config.yaml