In ocean voyages, cabin indoor localization plays a considerably important role in ship safety management. Due to the special structure of ships and the influence of internal and external environment, the mainstream indoor positioning technology nowadays is not ideal for positioning inside the cabin. In order to improve the positioning accuracy, this article proposes an adaptive K-value-based cabin indoor positioning algorithm. The algorithm constructs a fingerprint library by collecting Received Signal Strength Indication data and carries out filtering; matches fingerprint information by adaptive K-values during the localization process, while using double K-nearest neighbor to reduce the influence of outlier points on the final localization; and finally uses the multi-point mass center method to determine the final localization results. The experimental results in the automated cabin laboratory show that the average positioning error of the algorithm is 1.74 m, which can well meet the cabin indoor positioning requirements.