Home > Backend Development > Golang > How to deploy golang project to linux server

How to deploy golang project to linux server

王林
Release: 2020-02-15 17:50:00
Original
5166 people have browsed it

How to deploy golang project to linux server

Install go and configure GOPATH.

The specific method is as follows:

1. Configure the server to the same local environment, including the packages that the project depends on;

2. Copy the project source code to the server. Compile on the server

go build main.go
Copy after login

After compilation, the executable file main will be generated in the same directory.

3. Finally execute ./main.

If you want the project to execute in the background: execute nohup ./main &, so that the program can run in the background.

Recommended related articles and tutorials: golang tutorial

The above is the detailed content of How to deploy golang project to linux server. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
How to choose golang web mvc framework
From 1970-01-01 08:00:00
0
0
0
Is it necessary to use nginx when using golang?
From 1970-01-01 08:00:00
0
0
0
golang - vim plug-in to write go
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template