Dev

Install Monaco Editor – Browser based Code Editor for Linux

Are you tired of using Desktop IDE and looking for a browser-based Code editor for your projects on Linux / macOS?. Monaco Editor is the code editor written in Node.js and it powers VS Code. You can read more about features of Monaco Editor from the official project website.

Original content from computingforgeeks.com - post 7457

Monaco Editor is licensed under the MIT License and has support for Chrome, Safari, Firefox, IE 11, Edge and Opera. It can be easily installed on any Linux system provided Node.js is present on the host system.

Installing Monaco Editor – Browser based Code Editor on Linux

Before installing Monaco Editor, you need to have Node.js installed.

### Debian / Ubuntu ###
sudo apt update && sudo apt install -y ca-certificates curl gnupg
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
NODE_MAJOR=20
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list
sudo apt update && sudo apt install git nodejs -y

### RHEL / Fedora / Rocky / CentOS ###
NODE_MAJOR=20
sudo yum install https://rpm.nodesource.com/pub_$NODE_MAJOR.x/nodistro/repo/nodesource-release-nodistro-1.noarch.rpm -y
sudo yum install git nodejs -y

Confirm the version of Node.js installed.

$ node -v
v20.7.0

$ npm -v
10.1.0

Once you have Node.js installed, run the following command to download and install Monaco Editor

git clone https://github.com/Microsoft/monaco-editor.git

Install required Node packages

$ cd monaco-editor/
$ npm install .
added 446 packages from 674 contributors and audited 1496 packages in 58.347s
found 5 vulnerabilities (1 low, 4 high)
  run npm audit fix to fix them, or npm audit for details

Then start simpleserver with:

$  npm run simpleserver
> [email protected] simpleserver
> ts-node ./build/simpleserver

Running at http://127.0.0.1:8080

Access Monaco Editor websites on  http://localhost:8080/monaco-editor/website/

monaco editor

Related Articles

Git Install Gitea Git service on Debian 11| Debian 10 Linux Mint How To Install Wine on Ubuntu or Linux Mint Ubuntu How To Install ISPConfig Control Panel on Ubuntu 22.04 Desktop Install Guacamole Remote Desktop on Ubuntu 22.04 (Jammy Jellyfish)

Leave a Comment

Press ESC to close