An injection device has a housing which includes a first housing part and a second housing part. The injection device has a receptacle for an injection needle. The receptacle is connected to a drive unit which moves the receptacle between proximal and distal end positions relative to the second housing part. The first housing part has a set piece for placing on the skin before triggering an injection. The first housing part is permanently fastened with respect to the second housing part. In a method for making the injection device, the first housing part is positioned on the second housing part so that the receptacle has a specified position relative to the set piece in the proximal end position thereof, and that the first housing part is permanently fastened in this position opposite the second housing part. A defined insertion depth can thus be ensured.