AWS Setup

Setting up MonetDB in AWS

When creating your MonetDB instance, make sure that it has at least the following items as its Inbound rules:

a. Type: SSH, Protocol TCP, Port range: 22, Source "My IP"

Connecting to the VM using SSH

To connect to your EC2 instance via SSH, type in your terminal:

ssh -i <.pem ssh key> monetdb@<Public DNS of EC2 instance>

Create and start a database

MonetDB uses a concept called dbfarm, which is a directory that can contain multiple databases. The MonetDB daemon program monetdbd manages one dbfarm at the same time. To communicate with monetdbd, one can use its client program monetdb. For more information regarding monetdbd and monetdb, and server setup visit the Server Setup and Configuration page.

When your MonetDB instance is first started, monetdbd is already running in the background serving a dbfarm at the default location /var/monetdb5/dbfarm. So, you can immediately create and start your first database with the following commands:

monetdb create <database name>
monetdb start <database name>

By default, such a newly created database is started in the "maintenance" mode so that the DB admin can configure the database (e.g. change admin password and create user accounts). While in this mode, the database is only accessible by the MonetDB superuser monetdb on the local machine.

To login to the database, you can use mclient, which is a client program of MonetDB and is available by default on your MonetDB instance:

mclient -u monetdb -d <database name>

By default, the password for the MonetDB superuser monetdb is also monetdb. So, it is strongly recommended to immediately change this default password, which can be done in the mclient console using the SQL command:


Once the database is set up, the DB admin can release the database so that other users can connect to this database:

monetdb release <database name>

To lock a database (again) for maintenance:

monetdb lock <database name>
monetdb stop <database name>
monetdb start <database name>

Release and lock can be done on a running database. It takes effect on new client connections. Therefore, in the commands above, we lock and restart the database to ensure no other users are still connected to the database.

A comprehensive guide can be found at Tutorial page.