Install Nextcloud + Collabora + Onlyoffice + E-mail server + LDAP server + Gitlab + Jenkins + Nexus +Sonar via Ansible and docker on your own server
You can install easily the basic service for a little startup, that doesn’t need a big infrastructure to work.
Change vars to your needs, the target host, and just execute
./install_cloud.sh
You will have a private cloud, instant messaging, online document editor and an e-mail server.
Additionaly, if you need an CI/CD environment for software development startup, your command is
./install_devtools.sh
This give you Gitlab, Jenkins, Nexus installations automatically.
Or if you need all of them, the magic words are:
./install_all.sh
All names for the subdomains could be customize via ansible vars at the installation time.
Vars are distributed among multiple files on the repository.
Name | Description | Change required | Default Value |
---|---|---|---|
public_server | The server is public and use letsencrypt to generate certs, and check domains. False value required to put your certs on their own directories | No | True |
install_proxy_base | Create proxy base. Mandatory to True if there is no previous installation. | No | True |
install_root | Create root domain with https cert. Usefull if you deploy some other service on root directory on the future. | No | True |
install_nextcloud | Install nextcloud server. | No | True |
install_email | Install email server. | No | True |
install_ldap | Install LDAP server. | No | True |
install_collabora | Install collabora server. | No | True |
install_onlyoffice | Install onlyoffice server. | No | True |
install_gitlab | Install gitlab server. | No | True |
install_jenkins | Install jenkins server. | No | True |
install_nexus | Install nexus server. | No | True |
install_sonar | Install sonar server. | No | True |
root_domain | Your root domain (And email domain name). | Yes | mydomain.com |
cloud_domain | Subdomain for nextcloud installation. | No | cloud.{{root_domain}} |
ldap_domain | Subdomain for LDAP installation. | No | ldap.{{root_domain}} |
mail_domain | Subdomain for email server installation. | No | mail.{{root_domain}} |
collabora_domain | Subdomain for collabora server installation. | No. | collabora.{{root_domain}} |
onlyoffice_domain | Subdomain for onlyoffice server installation. | No | onlyoffice.{{root_domain}} |
gitlab_domain | Subdomain for gitlab installation. | No | gitlab.{{root_domain}} |
jenkins_domain | Subdomain for jenkins installation. | No | jenkins.{{root_domain}} |
nexus_domain | Subdomain for nexus installation. | No | nexus.{{root_domain}} |
sonar_domain | Subdomain for sonar installation. | No | sonar.{{root_domain}} |
email_certbot | Email to use on letsencrypt cert generator. | Yes | admin@mydomain.com |
root_directory_deploy | Root installation directory. | No | /opt |
directory_deploy_cloud | Installation directory cloud services. | No | {{root_directory_deploy}}/cloud |
directory_volumes_cloud | Installation directory for data cloud services. | No | {{directory_deploy_cloud}}/dockervolumes |
directory_scripts_cloud | Installation directory for scripts cloud services. | No | {{directory_deploy_cloud}}/dockerscripts |
directory_deploy_devtools | Installation directory devtools services. | No | {{root_directory_deploy}}/devtools |
directory_volumes_devtools | Installation directory for data devtools services. | No | {{directory_deploy_devtools}}/dockervolumes |
directory_scripts_devtools | Installation directory for scripts devtools services. | No | {{directory_deploy_devtools}}/dockerscripts |
directory_deploy_proxy | Installation directory proxy. | No | {{root_directory_deploy}}/proxy |
Name | Description | Change required | Default Value |
---|---|---|---|
docker_compose_version | Docker compose version to install | No | 1.25.4 |
Name | Description | Change required | Default Value |
---|---|---|---|
initial_openldap_admin_password | Password for LDAP admin user | Yes | changemenow |
openldap_organisation_name | Name of your organisation to LDAP server | Yes | organisation |
Name | Description | Change required | Default Value |
---|---|---|---|
secret_collabora | Secret for Collabora admin user | Yes | longsecretfornoonefigureout |
Name | Description | Change required | Default Value |
---|---|---|---|
secret_onlyoffice | Secret for Onlyoffice | Yes | longsecretfornoonefigureout |
Name | Description | Change required | Default Value |
---|---|---|---|
initial_nextcloud_admin_password | Password for Nextcloud admin user | Yes | changemenow |
All services will be deployed over HTTPS, and certificates are needed.
If your server will have access from Internet, you can use the free https certs generator Let’s Encrypt, setting up public_server var to True. This option generate https certs for all services subdomains to install, and you don’t pay attention to renovate it.
If your server won’t be accessed from Internet, or if it’s public and you have certs for all subdomains, you can put your certs on their directories, and these will be installed.
Your certs have to be named as:
Directories to save your certs:
Ansible playbook is a list of independent complex tasks (Named as roles), to execute consecutively to reach you target.
Three playbooks exist:
Related to these playbook, exists three script to launch easily the playbooks:
List of roles and their description
Name | Description | Included on playbook |
---|---|---|
checkdocker | Check and install docker and it’s dependencies on the target host. | All |
checkdomainscloud | Check Nextcloud, e-mail, collabora and onlyoffice subdomains with their public IPs (Only with public server var active). | install_all, install_cloud |
checkdomainsdevtools | Check Gitlab, Jenkins and Neux subdomains with their public IPs(Only with public server var active). | install_all, install_devtools |
proxy | Install proxy (Only with install_proxy_base var active) and the root certificate (Only with install_root var active). | All |
proxycloud | Install proxy config, generate certs https (Only with public_server var active), copy your own https cert certificates (Only with public_server var to False) to Nextcloud, E-mail, Collabora and Onlyoffice | install_all, install_cloud |
proxydevtools | Install proxy config, generate certs https (Only with public_server var active), copy your own https cert certificates (Only with public_server var to False) to Gitlab, Jenkins and Nexus | install_all, install_devtools |
Install e-mail server (Only with install_email var to True) | install_all, install_cloud | |
collabora | Install Collabora server (Only with install_collabora var to True) | install_all, install_cloud |
onlyoffice | Install Onlyoffice server (Only with install_onlyoffice var to True) | install_all, install_cloud |
nextcloud | Install Nextcloud server (Only with install_nextcloud var to True) | install_all, install_cloud |
openldap | Install LDAP server (Only with install_ldap var to True) | install_all, install_cloud |
gitlab | Install Gitlab server (Only with install_gitlab var to True) | install_all, install_devtools |
jenkins | Install Jenkins server (Only with install_jenkins var to True) | install_all, install_devtools |
nexus | Install Nexus server (Only with install_nexus var to True) | install_all, install_devtools |
sonar | Install Sonar server (Only with install_sonar var to True) | install_all, install_devtools |
showadminpasswords | Show initial admin passwords auto generated by Jenkins and Nexus | install_all, install_devtools |
To execute installer, you will need modify hosts.cfg to enter your access data.
Example:
10.0.0.12 ansible_ssh_user=myuser ansible_ssh_pass=mypassword ansible_become_pass=mypassword
If your user, it’s not the root user, you need sudo permissions to execute this installer and ansible_become_pass is required.
First of all, you need to install Ansible on your machine (Not the server, you own computer) to execute installer. Ansible can be installed on many ways, described on it’s website.
Steps to install:
After the installation process you can access services on this URIs if you didn’t change subdomains
ssh root@10.0.0.15
Pull requests are wellcome ;)