Skip to content
Terraform provider to manage components of a linux system.
Go Shell Makefile
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Terraform Linux Provider Build Status

I realize that the name 'Linux Provider' is misleading, but I needed this provider and couldn't find a more suitable name.


  • Terraform 0.12.x
  • Go 1.12 (to build the provider plugin)


provider "linux" {
  host = ""
  user = "user"

Building The Provider

Clone repository to: $GOPATH/src/

$ mkdir -p $GOPATH/src/; cd $GOPATH/src/
$ git clone

Enter the provider directory and build the provider

$ cd $GOPATH/src/
$ make build

Using the provider

Sample configuration for creating a few users/groups:

resource "linux_group" "testgroup" {
  name = "testgroup"
  system = false

resource "linux_user" "testuser1" {
  name = "testuser1"
  gid = linux_group.testgroup.gid
  system = false

resource "linux_user" "testuser2" {
  name = "testuser2"
  gid = linux_group.testgroup.gid
  system = false

Developing the Provider

If you wish to work on the provider, you'll first need Go installed on your machine (version 1.11+ is required). You'll also need to correctly setup a GOPATH, as well as adding $GOPATH/bin to your $PATH.

To compile the provider, run make build. This will build the provider and put the provider binary in the $GOPATH/bin directory.

$ make build
$ $GOPATH/bin/terraform-provider-linux

In order to test the provider, you can simply run make test. Note: These tests will require docker installed to spin up a container with ssh access.

$ make test

In order to run the full suite of Acceptance tests, run make testacc.

$ make testacc

In order to run only single Acceptance tests, execute the following steps:

# setup the testing environment
$ source ./scripts/

# run single tests
TF_LOG=INFO TF_ACC=1 go test -v ./linux -run TestAccUserCreation -timeout 360s

# cleanup the local testing resources
$ source ./scripts/
You can’t perform that action at this time.