Can you code on a Chromebook?

Modified Nov. 3, 2023, 8:49 p.m.

10 likes

You have or plan to buy a Chromebook and wondering if you can code with it, I’ve tried many things on my Chromebook, and here is how to code.

Yes, you can code on a Chromebook as you can enable Linux, even if they are cheap. As ChromeOS now allows enabling Linux, almost everything that can be done on Linux can be done on a Chromebook. Coding on Linux is not complicated, it’s even the operating system preferred by some developers.

How to code on a Chromebook?

The first thing you need to do to code on a Chromebook is to enable Linux.

Enable Linux

Here are the steps to enable Linux on a Chromebook :

  • Go to the Settings application on your Chromebook
  • Go to Advanced → Developers menu
  • Turn On the “Linux development environment” option
  • Instructions to complete the Linux setup will appear, once you’re done you will be able to access the Terminal application, which is a Debian Terminal.

Install the requirements for the language

This part depends on which language you want to code with. Every language needs more components to install via the Terminal app, you will have to install them using the command sudo apt install name_of_component

There are plenty of tutorials on how to use each language on Linux, just search for how to code with your language on Debian.

Install an IDE for the language

An IDE, an Integrated development environment, is an editor that you can use to make development easier. There is a lot of different IDE and each one of them is better for a specific language.

You might want to look for an IDE that fits well with the language you want to use in your coding projects. The most famous one today is Visual Studio Code, made by Microsoft, this IDE can be used with many different languages as there is an extension system. Follow the steps below if you want to code using VS Code.

Coding on a Chromebook using VS code

Visual Studio Code is a free and open-source editor made by Microsoft that will make your coding experience easier. VS code is extensible and customizable with the extension system and all the parameters. It can be used to code using any coding language, a perfect tool to be able to code on your Chromebook in an easy way. Here are the steps to install VS Code on your Chromebook.

  1. First, be sure to enable Linux as I explained above.
  2. Open the Terminal application and enter these two commands to update the list of Linux packages and install the required dependency for VS code :
    • sudo apt-get update
    • sudo apt-get install -y gnome-keyring
  1. Download VS Code from the official website here
    • Most of the time your Chromebook will need the 64-bit version, click on the 64-bit button next to .deb
    • If your Chromebook is running on an ARM64 architecture, then you need to click on the ARM 64.deb
  1. Once the download is over, go to your file system and double-click on the file you’ve just downloaded to install VS code.

That’s it, Visual Studio Code is now installed and you can use it to code on your Chromebook.

Can you code Python on a Chromebook?

Yes, you can code Python on a Chromebook, you will first need to enable Linux and then install a few components using the Terminal app. The steps to code Python on your Chromebook are:

  1. Enable Linux using the steps described above
  2. Open the Terminal application on your Chromebook and enter these commands to update the list of Linux packages and install the required components and dependencies:
    • sudo apt-get update
    • sudo apt-get install python3 python3-pip python3-venv build-essential libssl-dev libffi-dev python3-dev
  1. Everything is installed and you now can code Python on your Chromebook, to get started you can enter this command in the Terminal :
    • python3

Can you code Java on a Chromebook?

Yes, you can code Java on a Chromebook. To code using Java language, you need to be able to compile the java source code file and use the Java Runtime Environment to run the compiled Java program. Here are the steps to code Java on a Chromebook:

  1. Enable Linux using the steps described above
  2. Open the Terminal application on your Chromebook and enter these commands to update the list of Linux packages and install the required components and dependencies:
    • sudo apt-get update
    • sudo apt-get install openjdk-8-jdk
  1. Everything is installed and you now can program and compile your Java program on your Chromebook
    • Edit a file with the Java code, let’s say you have a class HelloWorld in a file hello.java
    • On the Terminal app, compile your code using the command javac hello.java
    • Run the compiled Java program with the command java HelloWorld

Conclusion

Coding on your Chromebook is definitely possible, but you will have to enable Linux first. Once Linux is enabled, coding on your Chromebook can be done entirely using the Terminal application, Python, Java, and C++, every language can be used to develop your program directly in the Terminal application using the proper command to compile and run the program. But it will be easier using an IDE and the best one today is Visual Studio Code, which is working great on Chromebook.

Author

maximelevesque

Maxime Levesque is a technical engineer with more than 5 years of professional experience. He is an expert in computer and phones, mostly on Apple products. Maxime is also the founder of TechBrowser.

Post your comment

Required for comment verification