The present invention provides an onboard device capable of further enhancing safety of an occupant aboard a vehicle. The onboard device controlling locking of a vehicle door includes an occupant detector detecting the occupant inside a vehicle, a shut door determiner determining whether the vehicle door is closed, and a locking controller locking the vehicle door when the shut door determiner determines that the vehicle door is closed and the occupant detector detects the occupant. By locking the vehicle door, a third party can be prevented from entering the vehicle through the vehicle door, for example, and the safety of the occupant aboard the vehicle can be further enhanced.