WARNING: This repository is meant to get Cockpit Next deployed on a Dokku instance. It is meant for personal use, and while you are more than welcome to use it, do not expect support with it. For all information about Cockpit itself, please visit Cockpit on Github.
- Homepage: http://getcockpit.com
- Twitter: @getcockpit
- Support Forum: https://discourse.getcockpit.com
Some modifications where made in order for the deployment to work as expected:
- Change to the Dockerfile to include the repository
- Add docker-config.php from cockpit-docker
- Change in the docker-config.php script to use the default
MONGO_URL
instead of the COCKPIT_DATABASE_SERVER andCOCKPIT_DATABASE_NAME
- Change the Dockerfile to use docker-config.php as the config script
- Docker
- Dokku (in sub domain config if possible)
- Dokku Mongo Addon
- Dokku Letsencrypt Addon
- Download this Cockpit Dokku repository (as a repo, not as git) to your development machine
- Make sure your development machine has the rights to push to the Dokku instance
- Add the Dokku remote address:
git remote add dokku dokku@your.dokku.url:APPNAME
whereyour.dokku.url
points to your machine andAPPNAME
is the name of your Cockpit application - Push to your code to Dokku: either use
git push dokku next:master
orgit push dokku next:refs/heads/master
when the first one fails (sometimes this happens on first builds). (Note: first build takes long enough to grab yourself a coffee) - Login to your Dokku instance and create a new MongoDB:
dokku mongo:create APPNAMEDB
whereAPPNAMEDB
is the name of your mongo database. - Link your Mongo Database to your application:
dokku mongo:link APPNAMEDB APPNAME
whereAPPNAMEDB
is the name of your db in step 5 andAPPNAME
is the name of your app in step 3. - Mount a persistent storage volume to your application:
dokku storage:mount APPNAME /var/lib/dokku/data/storage/APPNAME:/var/www/html/storage
where once againAPPNAME
stands for the chosen application name in Step 3 - Make the storage folder
mkdir -p /var/lib/dokku/data/storage/APPNAME
(might require sudo) - Go to your freshly created folder:
cd /var/lib/dokku/data/storage/APPNAME
- Make the necessary subfolders:
mkdir cache data thumbs tmp uploads
(might require sudo) - Set the correct rights to the folder and subfolders:
chmod 777 -R /var/lib/dokku/data/storage/APPNAME
(might require sudo) - Rebuild the application for the changes to take effect:
dokku ps:rebuild APPNAME
- Go to APPNAME.your.dokku.url/install to receive a new username/password (usually admin/admin)
- Click the login button at the bottom of the page & log in with admin/admin
- Go to your account cirle in the top right > press Account and change your password & email!
You might want to go further and test if everything is set up correctly with the next section.
To test the installation, the easiest way is to create something and then rebuild the app.
- On the dashboard press 'Create a singleton'
- Set the following:
name: test
label: test
description: test
- Add a field and call the fieldname
test
- Press SAVE
- Next to save press SHOW FORM
- enter
test
as value and press save
Now the database has some data (the singleton content) and the storage has some data (the singleton format & fields). Proceed by restarting the app
dokku ps:rebuild APPNAME
- Go to APPNAME.your.dokku.url and log in with your new password (and new account name if you changed that in the settings)
- If all went well you will be able to log in; if not try to visit APPNAME.your.dokku.url/install and check if the instalation already happened. If not, you've got a problem with your MongoDB
If you see the test
singleton, both your storage and MongoDB are running as expected. If you don't see the singleton there is a problem with your storage mount
To further check your MongoDB when your storage is broken, you can recreate steps 1 to 5. If Mongo was configured correctly you'll see that test
has been prefilled by the DB.
To ensure save data tranfer, get a free ssl certificate from letsencrypt:
- Set your contact details:
dokku config:set --no-restart APPNAME DOKKU_LETSENCRYPT_EMAIL=YOUR_EMAIL
where APPNAME is the name of your application and YOUR_EMAIL is your actual email address (this is important) - Generate the certificate:
dokku letsencrypt APPNAME
- Make sure you always have a fresh certificate:
dokku letsencrypt:cron-job --add
If you now log out and go back to APPNAME.your.dokku.url you should be getting the https connection & lock. You'll keep having it when you log back in.
-
For easy adding of groups to your cockpit, see: https://github.com/serjoscha87/cockpit_GROUPS
-
For group based assets, see: https://github.com/serjoscha87/cockpit_GroupBoundAssets
-
For external storage, you can use: https://github.com/agentejo/CloudStorage (note that with agentejo/CloudStorage#3, we might see Minio support soon. Minio also works on dokku)
-
For more official plugins, see: https://github.com/agentejo
dokku apps:destroy APPNAME
, confirm by typing APPNAMEdokku mongo:destroy APPNAMEDB
, configry by typing APPNAMEDBrm -rf /var/lib/dokku/data/storage/APPNAME
(might require sudo)
Copyright 2015 Agentejo under the MIT license.
The MIT License (MIT)
Copyright (c) 2015 Agentejo, http://agentejo.com
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
We create websites and apps that click with users.
Live, Web-Based Browser Testing
Thank you to all our backers! 🙏 [Become a backer]
Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [Become a sponsor]