In this tutorial, we will guide you through the process of installing SQLite on an Ubuntu 16.04 Cloud VPS, which is fast, easy, and can be done in less than 5 minutes.
SQLite is a software library that provides a relational database management system (RDBMS). It can work as a database engine for small sized websites as well as large websites and projects, and it comes with a lot of useful features. The maximum size of a SQLite database is about 140 terabytes, making it future proof as well. Used by millions of users around the world, including some of the well-known companies such as Google, Facebook, Adobe, Microsoft and others, it is the most widely deployed database engine. Let’s begin with the installation.
Some of SQLite’s features are listed below:
- Transactions are atomic, consistent, isolated, and durable (ACID) even after system crashes and power failures.
- Zero-configuration – no setup or administration needed.
- Full-featured SQL implementation with advanced capabilities like partial indexes, indexes on expressions, JSON, and common table expressions. (Omitted features)
- A complete database is stored in a single cross-platform disk file. Great for use as an application file format.
- Supports terabyte-sized databases and gigabyte-sized strings and blobs. (See limits.html.)
- Small code footprint: less than 600KiB fully configured or much less with optional features omitted.
- Simple, easy to use API.
- SQLite is very fast. In some cases, it is faster than direct filesystem I/O
- Written in ANSI-C. TCL bindings included. Bindings for dozens of other languages available separately.
- Well-commented source code with 100% branch test coverage.
- Available as a single ANSI-C source-code file that is easy to compile and hence is easy to add into a larger project.
- Self-contained: no external dependencies.
- Cross-platform: Android, *BSD, iOS, Linux, Mac, Solaris, VxWorks, and Windows (Win32, WinCE, WinRT) are supported out of the box. Easy to port to other systems.
- Sources are in the public domain. Use for any purpose.
- Comes with a standalone command-line interface (CLI) client that can be used to administer SQLite databases
- LC VPS-1 Cloud VPS with Ubuntu 16.04 Server
- SSH access with root privileges
Step 1. Log in and Update the Server
Login to your Ubuntu Cloud VPS via as user root
ssh [email protected]_Address -p Port_number
Replace ‘IP_Address’ and ‘Port_number’ with your actual IP address and the SSH port number.
and as usual, make sure that all installed packages on the server are updated to the latest available version.
apt update && apt upgrade
Step 2. Install SQLite
Method 1: Installing SQLite with the apt Package Manager
The SQLite module is part of the standard Python library in Ubuntu and no further installation is required. However, in order to be able to manage SQLite through the command line, we will have to install the SQLite command line interface. It is available in the official Ubuntu 16.04 repositories and it can be simply installed using Ubuntu’s package manager – apt (Advanced Package Tool). To do this, run the following command as user root
For SQLite 2
apt -y install sqlite libsqlite-dev
For SQLite 3
apt -y install sqlite3 libsqlite3-dev
Method 2: Installing SQLite from Source
If you need a specific version of SQLite, you can always compile it from the source code. Download the version you need from SQLite’s official website to your server. We will use the latest version at the time of writing this article, which currently is 3.25.3.
Unpack the downloaded tarball:
tar zxf sqlite-autoconf-3250300.tar.gz
This will create a new ‘sqlite-autoconf-3250300’ directory. Change the current working directory to this one:
and run the following commands to compile and install SQLite to your Ubuntu 16.04 Cloud VPS:
./configure make make install
Once the installation is completed, you can execute the following commands to check and verify that SQLite is properly installed:
sqlite3 -version 3.25.3 2018-11-05 20:37:38 89e099fbe5e13c33e683bef07361231ca525b88f7907be7092058007b75036f2
That’s all! If you closely followed the tutorial, you have successfully installed SQLite on your Ubuntu 16.04 Cloud VPS and you can create your first database. For more information on how to use SQLite, please visit their official documentation.
Of course, you don’t have to install SQLite on Ubuntu 16.04 if you use one of our Ubuntu Cloud VPS Hosting services, in which case you can simply ask our expert Linux admins to install SQLite for you. They are available 24×7 and will take care of your request immediately.
PS. If you liked this post on how to install SQLite on Ubuntu 16.04, please share it with your friends on the social networks using the share shortcuts, or simply leave a reply. Thank you.