You can use the code below if you dont want to use jQuery UI or any third party pluggin. It's only plain jQuery.
This answer works well with Bootstrap v3.x . For version 4.x see @User comment below
$(".modal").modal("show");_x000D_
_x000D_
$(".modal-header").on("mousedown", function(mousedownEvt) {_x000D_
var $draggable = $(this);_x000D_
var x = mousedownEvt.pageX - $draggable.offset().left,_x000D_
y = mousedownEvt.pageY - $draggable.offset().top;_x000D_
$("body").on("mousemove.draggable", function(mousemoveEvt) {_x000D_
$draggable.closest(".modal-dialog").offset({_x000D_
"left": mousemoveEvt.pageX - x,_x000D_
"top": mousemoveEvt.pageY - y_x000D_
});_x000D_
});_x000D_
$("body").one("mouseup", function() {_x000D_
$("body").off("mousemove.draggable");_x000D_
});_x000D_
$draggable.closest(".modal").one("bs.modal.hide", function() {_x000D_
$("body").off("mousemove.draggable");_x000D_
});_x000D_
});
_x000D_
.modal-header {_x000D_
cursor: move;_x000D_
}
_x000D_
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>_x000D_
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>_x000D_
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>_x000D_
_x000D_
<div class="modal fade" tabindex="-1" role="dialog">_x000D_
<div class="modal-dialog" role="document">_x000D_
<div class="modal-content">_x000D_
<div class="modal-header">_x000D_
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>_x000D_
<h4 class="modal-title">Modal title</h4>_x000D_
</div>_x000D_
<div class="modal-body">_x000D_
<p>One fine body…</p>_x000D_
</div>_x000D_
<div class="modal-footer">_x000D_
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>_x000D_
<button type="button" class="btn btn-primary">Save changes</button>_x000D_
</div>_x000D_
</div><!-- /.modal-content -->_x000D_
</div><!-- /.modal-dialog -->_x000D_
</div>
_x000D_