Programming languages that you can use to build applications for Raspberry Pi, via Raspbian Stretch Lite
A programming language give programmers an interface to create computer applications to serve different use cases. On the other hand, a Raspberry Pi is one of the things that a programmer should consider getting.
Raspbian Stretch Lite is the official operating system for programmers to run server applications on a Raspberry Pi. You can use Raspbian Stretch Lite for applications that do not require a graphical user interface.
So what programming languages can you use for building applications for Raspbian Stretch Lite?
This post discusses some programming languages that you can use for building applications for Raspbian Stretch Lite.
Python on Raspbian Stretch Lite
Python is one of the most versatile programming languages that can help us build different kinds of applications.
For example, you can use Python to:
- interact with the GPIO pins on your Raspberry Pi for IOT projects that interface with your home appliances.
- build a web interface to communicate with your Raspberry Pi
- include machine learning capabilities into your application.
Both Python 2 and Python 3 are included on Raspbian Stretch Lite.
Since Python 2 is reaching end of life soon, I recommend using Python 3 on Raspbian Stretch Lite. This is how to setup Raspbian Stretch Lite on Raspberry Pi 3 to run Python 3 applications.
Some articles on setting up Python 3 applications on Raspbian Stretch Lite:
- How to setup Jupyter Notebook on Raspberry Pi 3 with Raspbian Stretch Lite, Supervisor and Virtualenv to run Python 3 codes
- How to deploy Python 3 Flask application on Raspberry Pi 3 with Raspbian Stretch Lite, Nginx, Supervisor, Virtualenv and Gunicorn
PHP on Raspbian Stretch Lite
While PHP can be used to build command-line applications, it is more widely used for web applications.
Indeed, it is a very popular server-side scripting language designed for web development.
Therefore, it powers many of the popular websites that had became part and parcel of our lives.
In case you had figured out why programmers should blog, you can consider putting up WordPress on Raspbian Stretch Lite. After that, you can write some PHP codes to create customized WordPress page templates for your blog.
When deploying PHP web applications, I personally prefer to deploy an instance of Nginx to serve as a reverse proxy server. As a result of doing so, I can optimize the delivery of static content from my server.
How to install PHP 7 on Raspbian Stretch Lite
To install PHP on Raspbian Stretch Lite, you can run the following commands in a terminal session with Raspbian Stretch Lite:
sudo apt-get update sudo apt-get install php7.0 php7.0-fpm -y
After the commands complete, your Raspbian Stretch Lite will have the PHP 7 command-line binary and the FastCGI Process Manager.
Some articles on setting up PHP applications on Raspbian Stretch Lite:
- How to host your own file sharing website on Raspberry Pi 3 with Raspbian Stretch Lite, Nginx, ProjectSend, MariaDB and PHP
- How to setup your own Wiki site on a Raspberry Pi 3 with Dokuwiki, Raspbian Stretch Lite, nginx and PHP
- How to setup Codiad Web IDE on your Raspberry Pi 3 with Raspbian Stretch Lite, Nginx and PHP
- How to setup phpMyAdmin on a Raspbian Stretch Lite, Nginx, MariaDB / MySQL and PHP 7 LEMP stack
- Setting up WordPress on Raspberry Pi Zero W with Raspbian Stretch Lite, nginx, MariaDB and PHP as the LEMP stack
- Setting up WordPress on Raspberry Pi 3 with Raspbian Stretch Lite, nginx, MariaDB and PHP 7 as the LEMP stack
Java on Raspbian Stretch Lite
The Java programming language is a popular object-oriented programming language that is used for creating many server and mobile applications in the world.
If you are a programmer looking to build Java applications for Raspberry Pi, Java is an option on Raspbian Stretch Lite.
How to install Java on Raspbian Stretch Lite
As I have noted in how I make my Java programs run faster on my Raspberry Pi 3, Oracle Java perform better on Raspberry Pi.
Therefore, we will want to install Oracle Java. To do so, run the following commands in your terminal session with Raspbian Stretch Lite:
sudo apt-get update sudo apt-get install oracle-java8-jdk -y
After the commands complete, you will be able to run Java applications on your Raspbian Stretch Lite.
Article on setting up Java application on Raspbian Stretch Lite:
Node.js on Raspbian Stretch Lite
Node.js is ideal for building real-time web applications such as a web chat program.
In case you want to build a Node.js application for your Raspberry Pi, you can install Node.js on your Raspbian Stretch Lite.
How to install Node.js on Raspbian Stretch Lite
Suppose that you want to install Node.js 6.x on your Raspbian Stretch Lite, you will run the following commands in a terminal session with Raspbian Stretch Lite:
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash - sudo apt-get install -y nodejs
After the commands complete, you should be able to run Node.js application on your Raspbian Stretch Lite.
You can find more Node.js setup scripts at Node.js Github repository.