draw.io for Confluence server 5.0 introduces the ability to create and share custom libraries within draw.io. Within the draw.io editor select File->New Library to create just that:
This will bring up the custom libraries dialog:
Having populated and saved your custom library it will then appear as a library in the left hand side library panel:
You can drag shapes from this new library into the drawing area as per any built-in shape. Custom libraries also have three small icons at the top right:
Add the current selection in the diagram to the custom library (see below).
Edit the custom library, this brings up the library dialog once more.
Close the custom library (this does not delete the library).
The add selection option enables you to select as much of the diagram as you wish, click the "+" icon in a custom library and that selection will be added to the library as a single shape to drag and drop back as you require.
File->Open Library shows you all available libraries, showing the name, author and a preview:
Select any library on the left hand side and press "open" to open that custom library in your editor. Also, custom libraries persist in the libraries panel per diagram, so if a diagram is using certain custom libraries, those always open with the diagram.