In this section you'll find basic information about Lynx and how to install it and use it properly. If you're first time user then you should read this section first.
Lynx is a Fast, Secure and Reliable Terraform Backend. A Terraform backend is a resource that stores the state file for a Terraform configuration. The state file is a crucial component in Terraform, as it keeps track of the resources created by your configuration and their metadata. This allows Terraform to map the real-world resources to the configuration, perform reconciliation, and plan future changes.
There are two main types of Terraform backends:
Some key benefits of using remote backends include:
There are several compelling reasons to choose a custom Terraform backend over AWS S3
, PostgreSQL
, or Terraform Cloud
, especially when considering the cost:
Team Collaboration and User Management: The custom backend offers robust team collaboration and user management capabilities, which can be particularly valuable for organizations with multiple teams and users working on different projects. This feature is not readily available in AWS S3 or PostgreSQL backends, and while Terraform Cloud provides similar functionality, it comes at a cost.
Project and Environment Management: The ability to manage multiple projects and environments within each project is a significant advantage. This level of organization and separation can be challenging to achieve with AWS S3 or PostgreSQL backends, and Terraform Cloud’s pricing model can become expensive for organizations with numerous projects and environments.
State Versioning and Rollback: The state versioning and rollback capabilities provided by the custom backend can be invaluable for maintaining control over your infrastructure and ensuring data integrity. While AWS S3 and PostgreSQL backends offer some versioning capabilities, the custom backend’s rollback feature can simplify the process of reverting to previous states, potentially saving time and effort.
RESTful Endpoints and Automation: The availability of RESTful endpoints and a Terraform provider can greatly simplify the automation and management of teams, users, projects, environments, and snapshots. This level of automation can be challenging to achieve with AWS S3 or PostgreSQL backends and may require additional tooling or custom scripts.
Authentication Support: The support for OAuth2 authentication providers like Azure AD, Keycloak, and Okta can be a significant advantage for organizations with existing authentication infrastructure or specific security requirements. Integrating with these providers can be more complex with AWS S3 or PostgreSQL backends.
Lynx requires a PostgreSQL database. No Object Storage is required.
To run Lynx
alone on port 4000
on docker.
$ apt-get install docker.io docker-compose -y
$ wget https://raw.githubusercontent.com/Clivern/Lynx/main/docker-compose.yml \
-O docker-compose.yml
$ docker-compose up -d
To run Lynx
behind nginx reverse proxy on port 80
on docker.
$ apt-get install docker.io docker-compose -y
$ wget https://raw.githubusercontent.com/Clivern/Lynx/main/docker-compose-nginx.yml \
-O docker-compose.yml
$ wget https://raw.githubusercontent.com/Clivern/Lynx/main/nginx.conf \
-O nginx.conf
$ docker-compose up -d
To run a 3 Nodes of Lynx
behind nginx reverse proxy on port 80 on docker.
$ apt-get install docker.io docker-compose -y
$ wget https://raw.githubusercontent.com/Clivern/Lynx/main/docker-compose-cluster.yml \
-O docker-compose.yml
$ wget https://raw.githubusercontent.com/Clivern/Lynx/main/nginx-cluster.conf \
-O nginx.conf
$ docker-compose up -d
Then go to the public URL (for example http://lynx.sh/
or http://localhost
or http://localhost:4000
) and provide the required informtaion to install Lynx.
elixir
, erlang
and PostgreSQL
$ apt-get update
$ apt-get upgrade -y
$ apt-get install -y postgresql \
elixir \
erlang-dev \
make \
build-essential \
erlang-os-mon \
inotify-tools \
erlang-xmerl
PostgreSQL
database, username and password# Create PostgreSQL user with password
$ sudo -u postgres psql -c "CREATE USER lynx WITH PASSWORD 'lynx';"
$ sudo -u postgres psql -c "ALTER USER lynx CREATEDB;"
# Create database
$ sudo -u postgres psql -c "CREATE DATABASE lynx_dev OWNER lynx;"
.env.example
.$ mkdir -p /etc/lynx
$ cd /etc/lynx
$ git clone https://github.com/Clivern/Lynx.git app
$ cd /etc/lynx/app
$ cp .env.example .env.local # Adjust the database configs and application port to be 80 for example
$ make deps
$ make migrate
/etc/systemd/system/lynx.service
[Unit]
Description=Lynx
[Service]
Type=simple
Environment=HOME=/root
EnvironmentFile=/etc/lynx/app/.env.local
WorkingDirectory=/etc/lynx/app
ExecStart=/usr/bin/mix phx.server
[Install]
WantedBy=multi-user.target
$ systemctl enable lynx.service
$ systemctl start lynx.service
Then go to the public URL (for example http://lynx.sh/
or http://localhost
or http://localhost:4000
) and provide the required informtaion to install Lynx.